1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-07-03 22:42:53 +02:00

Send syntheses

This commit is contained in:
Yohann D'ANELLO
2020-05-05 00:11:38 +02:00
parent 26eacad2fd
commit b55aa6f4f3
12 changed files with 219 additions and 50 deletions

View File

@ -64,10 +64,22 @@ class Tournament(models.Model):
verbose_name=_("year"),
)
@property
def linked_organizers(self):
return ['<a href="{url}">'.format(url=reverse_lazy("member:information", args=(user.pk,))) + str(user) + '</a>'
for user in self.organizers.all()]
@property
def solutions(self):
from member.models import Solution
return Solution.objects.filter(team__tournament=self)
return Solution.objects.filter(final=self.final) if self.final \
else Solution.objects.filter(team__tournament=self)
@property
def syntheses(self):
from member.models import Synthesis
return Synthesis.objects.filter(final=self.final) if self.final \
else Synthesis.objects.filter(team__tournament=self)
@classmethod
def get_final(cls):