diff options
author | Alban Gruin | 2017-03-26 14:25:16 +0200 |
---|---|---|
committer | Alban Gruin | 2017-03-26 14:25:16 +0200 |
commit | 10e90edecc88cb45ac7c88c9ec77de00d656d470 (patch) | |
tree | c18e4d5e565f3173f879d2484d3e0ab130264ee1 /models.py | |
parent | ce0ed9347adde9ca80c11efe79766c966d5749ba (diff) | |
parent | b0154d43011825731b0e4ff7c4f44b7f5770b3c2 (diff) |
Merge branch 'stable/0.7.z' into prod/pa1ch/0.7.zv0.7.1-pa1ch
Diffstat (limited to 'models.py')
-rw-r--r-- | models.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -66,14 +66,14 @@ class Group(models.Model): timetable = models.ForeignKey(Timetable, on_delete=models.CASCADE, verbose_name="emploi du temps") mention = models.CharField(max_length=32) - subgroup = models.CharField(max_length=1, verbose_name="sous-groupe") + subgroup = models.CharField(max_length=1, verbose_name="sous-groupe", null=True) td = models.IntegerField(verbose_name="groupe de TD", null=True) tp = models.IntegerField(verbose_name="groupe de TP", null=True) slug = models.SlugField(max_length=64, default="") 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) + 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) @property def group_info(self): |