passing an argument to a custom save() method

Posted by Nick on Stack Overflow See other posts from Stack Overflow or by Nick
Published on 2010-03-29T02:09:29Z Indexed on 2010/03/29 2:13 UTC
Read the original article Hit count: 188

Filed under:
|

How do I pass an argument to my custom save method, preserving proper *args, **kwargs for passing to te super method? I was trying something like:

form.save(my_value)

and

def save(self, my_value=None, *args, **kwargs):

   super(MyModel, self).save(*args, **kwargs)

   print my_value

But this doesn't seem to work. What am I doing wrong?

© Stack Overflow or respective owner

Related posts about django-models

Related posts about django