示例#1
0
def add_band_slug(instance, **kwargs):
    if not instance.slug:
        unique_slugify(instance,
                       instance.name,
                       queryset=models.Band.objects.all())
示例#2
0
def slugify(sender, instance, created, **kwargs):
    if created:
        instance.slug = instance.title
        unique_slugify(instance, instance.slug)
        instance.save()
示例#3
0
    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)
示例#4
0
    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)
示例#5
0
 def save(self, *args, **kwargs):
     self.slug = self.title
     unique_slugify(self, self.slug)
     super(Listing, self).save(*args, **kwargs)
示例#6
0
    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)