diff options
author | Alban Gruin | 2017-11-19 00:19:21 +0100 |
---|---|---|
committer | Alban Gruin | 2017-11-27 12:11:31 +0100 |
commit | 700d4218b84c45bb37a150f0ec1c9bf6866b3bf3 (patch) | |
tree | 0585bc5fd71f9b9c4f95f360da91ac988a19a861 /models.py | |
parent | 679010e9cb526709963ebcf49450c1c7c1ef105e (diff) |
À QUOI ÇA SERT DE FAIRE DES SUPERS MODÈLES ABSTRAITS SI ON S’EN SERT
PAS APRÈS AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Diffstat (limited to 'models.py')
-rw-r--r-- | models.py | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -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" |