set settings

This commit is contained in:
Egor Matveev
2022-01-20 03:12:17 +03:00
parent a12a97b9aa
commit aee08c937a
8 changed files with 83 additions and 90 deletions

View File

@@ -1,3 +1,5 @@
from functools import cached_property
from django.contrib.auth.models import User
from django.db import models
from django.utils import timezone
@@ -21,6 +23,6 @@ class Set(models.Model):
and (self.end_time is None or timezone.now() <= self.end_time)
)
@property
@cached_property
def tasks(self):
return Task.objects.filter(settasks__set=self).order_by("settasks__name")