From 5ebf37dddf5ee8bb8dbc9c167ebb30c7fc537e19 Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Sat, 11 Feb 2017 11:44:29 +0100 Subject: Ajout d'une propriété dans les groupes pour récupérer le tuple des informations du groupe --- models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/models.py b/models.py index 2100d35..0d3f2c0 100644 --- a/models.py +++ b/models.py @@ -75,6 +75,10 @@ class Group(models.Model): def corresponds_to(self, timetable_id, mention, subgroup, td, tp): return self.timetable.id == timetable_id and self.mention == mention and self.subgroup == subgroup and (self.td == td or self.td is None or td is None) and (self.tp == tp or self.tp is None or tp is None) + @property + def group_info(self): + return self.timetable.id, self.mention, self.subgroup, self.td, self.tp + def __str__(self): return self.name -- cgit v1.2.1