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

Drop a lot of Corres2math content

This commit is contained in:
Yohann D'ANELLO
2020-12-28 18:52:50 +01:00
parent f5ec9d1054
commit 7ef602c6cd
28 changed files with 63 additions and 1286 deletions

View File

@ -44,6 +44,14 @@ class Team(models.Model):
help_text=_("The access code let other people to join the team."),
)
@property
def students(self):
return self.participants.filter(studentregistration__isnull=False)
@property
def coachs(self):
return self.participants.filter(coachregistration__isnull=False)
@property
def email(self):
"""
@ -224,33 +232,6 @@ class Participation(models.Model):
help_text=_("The video got the validation of the administrators."),
)
solution = models.OneToOneField(
"participation.Video",
on_delete=models.SET_NULL,
related_name="participation_solution",
null=True,
default=None,
verbose_name=_("solution video"),
)
received_participation = models.OneToOneField(
"participation.Participation",
on_delete=models.PROTECT,
related_name="sent_participation",
null=True,
default=None,
verbose_name=_("received participation"),
)
synthesis = models.OneToOneField(
"participation.Video",
on_delete=models.SET_NULL,
related_name="participation_synthesis",
null=True,
default=None,
verbose_name=_("synthesis video"),
)
def get_absolute_url(self):
return reverse_lazy("participation:participation_detail", args=(self.pk,))
@ -324,7 +305,7 @@ class Solution(models.Model):
class Meta:
verbose_name = _("solution")
verbose_name_plural = _("solutions")
unique_by = (('participation', 'problem', 'final_solution', ), )
unique_together = (('participation', 'problem', 'final_solution', ), )
class Synthesis(models.Model):
@ -359,4 +340,4 @@ class Synthesis(models.Model):
class Meta:
verbose_name = _("synthesis")
verbose_name_plural = _("syntheses")
unique_by = (('participation', 'pool', 'type', ), )
unique_together = (('participation', 'pool', 'type', ), )