aboutsummaryrefslogtreecommitdiff
path: root/models.py
diff options
context:
space:
mode:
authorAlban Gruin2017-02-05 13:40:25 +0100
committerAlban Gruin2017-02-05 13:40:25 +0100
commit5363b70a7840f937f710e0a85fa83e48a35e083a (patch)
tree35371c3fc4b76a533293e97715faba87e4160fe5 /models.py
parent49eca350c06d9c3e2c45a1215e2d98acee0535c1 (diff)
RĂ©-introduction du slug de l'emploi du temps dans les urls
Diffstat (limited to 'models.py')
-rw-r--r--models.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/models.py b/models.py
index ff4897b..2f130a3 100644
--- a/models.py
+++ b/models.py
@@ -51,7 +51,7 @@ class Group(models.Model):
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, unique=True, default="")
+ 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)
@@ -83,7 +83,7 @@ class Group(models.Model):
class Meta:
index_together = ("mention", "subgroup", "td", "tp",)
- unique_together = (("name", "timetable",), ("celcat_name", "timetable",),)
+ unique_together = (("name", "timetable",), ("celcat_name", "timetable",), ("slug", "timetable",),)
verbose_name = "groupe"
verbose_name_plural = "groupes"