From 700d4218b84c45bb37a150f0ec1c9bf6866b3bf3 Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Sun, 19 Nov 2017 00:19:21 +0100 Subject: À QUOI ÇA SERT DE FAIRE DES SUPERS MODÈLES ABSTRAITS SI ON S’EN SERT PAS APRÈS AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA --- models.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/models.py b/models.py index 369a4a6..66d5ae5 100644 --- a/models.py +++ b/models.py @@ -84,7 +84,7 @@ class GroupManager(Manager): timetable=group.timetable) -class Group(models.Model): +class Group(SlugModel): objects = GroupManager() name = models.CharField(max_length=255, verbose_name="nom") @@ -121,7 +121,6 @@ class Group(models.Model): def save(self, *args, **kwargs): if self.name == "": self.name = self.celcat_name - self.slug = slugify(self.name) self.mention, self.semester, self.subgroup = parse_group(self.name) if self.subgroup is None: @@ -140,17 +139,13 @@ class Group(models.Model): verbose_name_plural = "groupes" -class Room(models.Model): +class Room(SlugModel): name = models.CharField(max_length=255, unique=True, verbose_name="nom") slug = models.SlugField(max_length=64, default="", unique=True) def __str__(self): return self.name - def save(self, *args, **kwargs): - self.slug = slugify(self.name) - super(Room, self).save() - class Meta: verbose_name = "salle" verbose_name_plural = "salles" -- cgit v1.2.1