django save() error

I got this got this error recently when trying to add the first entry of a model in the Admin section:


Request Method: GET
Request URL: http://mydomain/admin/escorts/escort/None/
Exception Type: ValueError
Exception Value: invalid literal for int() with base 10: 'None'

Exception Location: /lib/python2.6/site-packages/django/db/models/fields/__init__.py in get_db_prep_value, line 361
Python Executable: /usr/bin/python

Turns out I had overridden the save() function and it had worked fine. However the models.py file got corrupted and I lost the last few lines of the file including a line from my overridden save() function:

super(myModel, self).save(force_insert=True)

Tags:

Leave a Reply