Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

custom save method django

def save(self, *args, **kwargs):
   if self.title == “i dont like coding”:
       return  # instance not save
   self.slug = slugify(self.title)
   super(Post, self).save(*args, **kwargs)
Source by ilovedjango.com #
 
PREVIOUS NEXT
Tagged: #custom #save #method #django
ADD COMMENT
Topic
Name
1+6 =