Pocket-E
Jan22

Django - save() got an unexpected keyword argument 'force_insert'

Author // Joel Categories // Quick Notes

You have a custom save() process defined in your business model like:

 
def save(self):
  if self.clean_name == "":
    self.clean_name = self.name
  super(Game, self).save()
 

Add *args and **kwargs to your save calls:

 
def save(self, *args, **kwargs):
  if self.clean_name == "":
    self.clean_name = self.name
  super(Game, self).save(*args, **kwargs)
 

You're welcome. :-)

About the Author

Comments (6)

  • MG
    MG
    11 December 2011 pm31 21:36 |

    Thanks, buddy!

  • SEO Essence
    SEO Essence
    26 May 2011 pm31 15:47 |

    Informative knowledge about how to do SEO of a website. I will share this among other people. I am the regular visitor of your site. I always gain Information from this website. I will recommend this website among other.

  • Anupam
    Anupam
    05 May 2011 pm31 22:03 |

    Thanks a lot. Save me some time.

  • gd
    gd
    04 April 2011 pm30 15:13 |

    Cheers! :D

  • Shrenik
    Shrenik
    27 January 2011 am31 06:47 |

    Thanks !!

  • Chris
    Chris
    24 November 2010 pm30 17:37 |

    Typed error into google, and you were like "Here's your problem, here's your solution. Well done."

Leave a comment

You are commenting as guest. Optional login below.


Cancel Submitting comment...