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

Add update note menu

This commit is contained in:
Yohann D'ANELLO
2021-01-14 18:21:22 +01:00
parent be8904079d
commit ef785a5eb8
8 changed files with 69 additions and 8 deletions

View File

@ -379,7 +379,8 @@ class Passage(models.Model):
final_solution=self.pool.tournament.final)
def avg(self, iterator) -> int:
return sum(iterator) / len(list(iterator))
items = [i for i in iterator if i]
return sum(items) / len(items) if items else 0
@property
def average_defender_writing(self):
@ -581,6 +582,9 @@ class Note(models.Model):
default=0,
)
def get_absolute_url(self):
return reverse_lazy("participation:passage_detail", args=(self.passage.pk,))
def __str__(self):
return _("Notes of {jury} for {passage}").format(jury=self.jury, passage=self.passage)