Example #1
0
    def save(self, *args, **kwargs):
        new_meal = True if not self.pk else False

        # name related operations
        if new_meal or hasattr(self, '_updated_name'):
            self.slug = custom_slugify(self.name)

        super(Meal, self).save(*args, **kwargs)
Example #2
0
 def save(self, *args, **kwargs):
     self.slug = custom_slugify(self.name, offset=30)
     super(Packet, self).save(*args, **kwargs)
Example #3
0
 def save(self, *args, **kwargs):
     self.slug = custom_slugify(self.name, offset=30)
     super(KnowledgeStore, self).save(*args, **kwargs)