Skip to main content

You can try the following.

Override the save method as:

def save(self, my_val, *args, **kwargs): print my_val # do_something here return super(MyModel, self).save(*args, **kwargs) 

On calling the save method as:

MyModel.save(my_val="fooooo") 

this will print my_val and save sa it it.

You can try the following.

Override the save method as:

def save(self, my_val, *args, **kwargs): print my_val # do_something here return super(MyModel, self).save(*args, **kwargs) 

On calling the save method as:

MyModel.save(my_val="fooooo") 

this will print my_val and save sa it it.

You can try the following.

Override the save method as:

def save(self, my_val, *args, **kwargs): print my_val # do_something here return super(MyModel, self).save(*args, **kwargs) 

On calling the save method as:

MyModel.save(my_val="fooooo") 

this will print my_val and save it.

added 15 characters in body
Source Link
ЯegDwight
  • 25.3k
  • 10
  • 47
  • 52

You can try this also:the following.

overrideOverride the save method as:

def save(self, my_val, *args, **kwargs): print my_val # do_something here return super(MyModel, self).save(*args, **kwargs) 

On calling the save method as:

MyModel.save(my_val="fooooo") 

this will print my_valmy_val and save sa it it.

You can try this also:

override save method as:

def save(self, my_val, *args, **kwargs): print my_val # do_something here return super(MyModel, self).save(*args, **kwargs) 

On calling save method as:

MyModel.save(my_val="fooooo") 

this will print my_val and save sa it it

You can try the following.

Override the save method as:

def save(self, my_val, *args, **kwargs): print my_val # do_something here return super(MyModel, self).save(*args, **kwargs) 

On calling the save method as:

MyModel.save(my_val="fooooo") 

this will print my_val and save sa it it.

added 24 characters in body
Source Link
j0k
  • 22.8k
  • 28
  • 81
  • 90

You can try this also:

override save method as: def save(self, my_val, *args, **kwargs): print my_val # do_something here return super(MyModel, self).save(*args, **kwargs)

def save(self, my_val, *args, **kwargs): print my_val # do_something here return super(MyModel, self).save(*args, **kwargs) 

On calling save method as: MyModel.save(my_val="fooooo")

MyModel.save(my_val="fooooo") 

this will print my_val and save sa it it

You can try this also:

override save method as: def save(self, my_val, *args, **kwargs): print my_val # do_something here return super(MyModel, self).save(*args, **kwargs)

On calling save method as: MyModel.save(my_val="fooooo")

this will print my_val and save sa it it

You can try this also:

override save method as:

def save(self, my_val, *args, **kwargs): print my_val # do_something here return super(MyModel, self).save(*args, **kwargs) 

On calling save method as:

MyModel.save(my_val="fooooo") 

this will print my_val and save sa it it

Source Link
Loading