aboutsummaryrefslogtreecommitdiff
path: root/models.py
diff options
context:
space:
mode:
authorAlban Gruin2017-01-27 21:40:24 +0100
committerAlban Gruin2017-01-27 21:44:06 +0100
commit4b9ff291e35163b6d0ffcff78878e9ba23bf23dc (patch)
tree2b2713b2eb280d9546a6c5856cc1e2e8d2c0dcdd /models.py
parent47624b1e6973e8a4394d9985a30e23db7fdfb096 (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 981d8fb..9bf5866 100644
--- a/models.py
+++ b/models.py
@@ -44,6 +44,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