I'm getting a save() got an unexpected keyword argument 'force_insert'
error. From this http://groups.google.com/group/django-users/browse_thread/thread/2471efd68d56ad59
it looks like the answer is to use:
def save(self, *args, **kwargs):
...
super(SiteUser, self).save(*args, **kwargs)
My question is how would you go about specifying force_insert=True
or force_insert=False
when doing that.
My code is:
def save(self, force_insert=False, force_update=False):
if not self.id:
self.pub_date = datetime.datetime.now()
self.updated_date = datetime.datetime.now()
self.description_html = markdown(self.description)
self.highlighted_code = self.highlight()
super(Snippet, self).save(force_insert, force_update)
kwargs
is a dict
. Set it as you would any other dict value.
kwargs['force_insert'] = True
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With