Esempio n. 1
0
    def save(self, *args, **kwargs):
        """Overwrites save to generate unique slug and a sortable ordering name"""
        if not self.slug:
            self.slug = unique_slug(self.value, type(self))

        if not self.ordering_name:
            self.ordering_name = self._generate_ordering_name()

        super().save(*args, **kwargs)
Esempio n. 2
0
    def save(self, *args, **kwargs):
        if not self.slug:
            value = str(self)
            self.slug = unique_slug(value, type(self))

        super().save(*args, **kwargs)
Esempio n. 3
0
 def save(self, *args, **kwargs):
     """Overwrites save to initialize the slug"""
     if not self.slug:
         value = str(self)
         self.slug = unique_slug(value, type(self))
     super().save(*args, **kwargs)