Пример #1
0
def set_slug(sender, instance, **kwargs):
    if not instance.slug or instance.slug is None:
        #    instance.slug = fnify(instance.name)
        return unique_slugify(instance, instance.name)
Пример #2
0
def set_slug(sender, instance, **kwargs):
    if not instance.slug or instance.slug is None:
    #    instance.slug = fnify(instance.name)
        return unique_slugify(instance, instance.name)
Пример #3
0
 def save(self, **kwargs):
     unique_slugify.unique_slugify(self, self.name, slug_field_name='identifier')
     if self.pk and self.data != self._old_data:
         self.update_attributes()
         super(Leaf, self).save()
     super(Leaf, self).save()
Пример #4
0
 def save(self, *args, **kwargs):
     if not self.slug or "slug" in kwargs:
         self.slug = defaultfilters.slugify(self.__unicode__())
     unique_slugify(self, self.slug)
     super(SlugifyModel, self).save(*args, **kwargs)