def add_band_slug(instance, **kwargs): if not instance.slug: unique_slugify(instance, instance.name, queryset=models.Band.objects.all())
def slugify(sender, instance, created, **kwargs): if created: instance.slug = instance.title unique_slugify(instance, instance.slug) instance.save()
def slug_employer(self): """Unique slugify related `User` instance with company's name""" self.user.slug = f"{self.company_name}" unique_slugify(self.user, self.user.slug)
def slug_student(self): """Unique slugify related `User` instance with student's full name""" self.user.slug = self.user.get_full_name unique_slugify(self.user, self.user.slug)
def save(self, *args, **kwargs): self.slug = self.title unique_slugify(self, self.slug) super(Listing, self).save(*args, **kwargs)
def save(self, *args, **kwargs): if not self.slug: unique_slugify(self, self.title) super(Recipe, self).save(**kwargs)
def save(self, *args, **kwargs): if not self.slug: unique_slugify(self, self.title) super(NameablePage, self).save(**kwargs)