aboutsummaryrefslogtreecommitdiff
path: root/models.py
diff options
context:
space:
mode:
authorAlban Gruin2017-01-27 21:40:24 +0100
committerAlban Gruin2017-01-28 12:59:35 +0100
commit6a7f243eabdc1007e8effcc6d8efa6a990fe40c1 (patch)
tree21472a22cc660eb6fc00ddd5b2f143b468394501 /models.py
parentc4049ef83e7e77bc7d4a9ab5795ce746eb8e8459 (diff)
Surcharge de l'opérateur in du modèle des groupes
Diffstat (limited to 'models.py')
-rw-r--r--models.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/models.py b/models.py
index 26bb63d..f1ff118 100644
--- a/models.py
+++ b/models.py
@@ -53,6 +53,9 @@ class Group(models.Model):
slug = models.SlugField(max_length=64, unique=True, default="")
+ def __contains__(self, group):
+ return self.timetable == group.timetable and self.mention == group.mention and self.subgroup == group.subgroup and (self.td == group.td or self.td is None or group.td is None) and (self.tp == group.tp or self.tp is None or group.tp is None)
+
def __str__(self):
return self.name