Caching and refactors
This commit is contained in:
parent
67b06d7856
commit
8f1c8d6c96
33 changed files with 485 additions and 381 deletions
|
@ -24,6 +24,7 @@ from judge.models.problem_data import (
|
|||
problem_data_storage,
|
||||
problem_directory_file_helper,
|
||||
)
|
||||
from judge.caching import cache_wrapper
|
||||
|
||||
__all__ = [
|
||||
"ProblemGroup",
|
||||
|
@ -439,6 +440,10 @@ class Problem(models.Model, PageVotable, Bookmarkable):
|
|||
"profile_id", flat=True
|
||||
)
|
||||
|
||||
@cache_wrapper(prefix="Pga")
|
||||
def get_authors(self):
|
||||
return self.authors.only("id")
|
||||
|
||||
@cached_property
|
||||
def editor_ids(self):
|
||||
return self.author_ids.union(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue