mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-07-17 02:15:53 +02:00
Send solutions
This commit is contained in:
@ -178,6 +178,10 @@ class Document(PolymorphicModel):
|
||||
verbose_name = _("document")
|
||||
verbose_name_plural = _("documents")
|
||||
|
||||
def delete(self, *args, **kwargs):
|
||||
self.file.delete(True)
|
||||
return super().delete(*args, **kwargs)
|
||||
|
||||
|
||||
class Authorization(Document):
|
||||
user = models.ForeignKey(
|
||||
@ -234,14 +238,15 @@ class Solution(Document):
|
||||
verbose_name=_("problem"),
|
||||
)
|
||||
|
||||
def save(self, **kwargs):
|
||||
self.type = "solution"
|
||||
super().save(**kwargs)
|
||||
final = models.BooleanField(
|
||||
default=False,
|
||||
verbose_name=_("final solution"),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("solution")
|
||||
verbose_name_plural = _("solutions")
|
||||
unique_together = ('team', 'problem',)
|
||||
unique_together = ('team', 'problem', 'final',)
|
||||
|
||||
def __str__(self):
|
||||
return _("Solution of team {trigram} for problem {problem}")\
|
||||
@ -274,13 +279,15 @@ class Synthesis(Document):
|
||||
verbose_name=_("round"),
|
||||
)
|
||||
|
||||
def save(self, **kwargs):
|
||||
self.type = "synthesis"
|
||||
super().save(**kwargs)
|
||||
final = models.BooleanField(
|
||||
default=False,
|
||||
verbose_name=_("final synthesis"),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("synthesis")
|
||||
verbose_name_plural = _("syntheses")
|
||||
unique_together = ('team', 'dest', 'round', 'final',)
|
||||
|
||||
def __str__(self):
|
||||
return _("Synthesis of team {trigram} that is {dest} for problem {problem}")\
|
||||
|
Reference in New Issue
Block a user