aboutsummaryrefslogtreecommitdiff
path: root/models.py
diff options
context:
space:
mode:
authorAlban Gruin2017-10-19 21:48:39 +0200
committerAlban Gruin2017-10-19 21:48:39 +0200
commit9efb1796aed00f4c7a8c9cd7e6b8a169318b1be0 (patch)
tree25df66bca70563b065b415a53f78dfe90919fc45 /models.py
parente983619333a715bbc35deecf019a95addb5b6009 (diff)
Adaptation de corresponds_to() et des tests de parsage
Diffstat (limited to 'models.py')
-rw-r--r--models.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/models.py b/models.py
index 868cbd1..c69bec3 100644
--- a/models.py
+++ b/models.py
@@ -97,12 +97,15 @@ class Group(models.Model):
hidden = models.BooleanField(verbose_name="caché", default=False)
- def corresponds_to(self, timetable_id, mention, subgroup, td, tp):
+ def corresponds_to(self, timetable_id, mention, subgroup):
+ subgroup_corresponds = True
+ if self.subgroup is not None and subgroup is not None:
+ subgroup_corresponds = subgroup.startswith(self.subgroup) or \
+ self.subgroup.startswith(subgroup)
+
return self.timetable.id == timetable_id and \
self.mention.startswith(mention) and \
- (self.subgroup == subgroup or self.subgroup is None) 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)
+ subgroup_corresponds
@property
def group_info(self):