Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

custom save method django

def save(self, *args, **kwargs):
    if self.id:
        print('updating')
    else:
        print('creating')
    super(Post, self).save(*args, **kwargs)
Source by ilovedjango.com #
 
PREVIOUS NEXT
Tagged: #custom #save #method #django
ADD COMMENT
Topic
Name
7+6 =