Add fulltext search

This commit is contained in:
cuom1999 2023-10-14 14:56:22 -05:00
parent aa1b627e6f
commit 36e505952c
7 changed files with 96 additions and 76 deletions

View file

@ -24,6 +24,7 @@ from judge.models.submission import Submission
from judge.ratings import rate_contest
from judge.models.pagevote import PageVotable
from judge.models.bookmark import Bookmarkable
from judge.fulltext import SearchManager
__all__ = [
"Contest",
@ -309,6 +310,7 @@ class Contest(models.Model, PageVotable, Bookmarkable):
comments = GenericRelation("Comment")
pagevote = GenericRelation("PageVote")
bookmark = GenericRelation("BookMark")
objects = SearchManager(("key", "name"))
@cached_property
def format_class(self):