Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#1010 closed defect (duplicate)

rev 1560 fails to save object

Reported by: anonymous Owned by: adrian
Component: Core (Other) Version: master
Severity: critical Keywords: Revision 1560
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Development server revision 1560.

After updating from I don't know which revision, A model that has the following fields:


When I create a new object for the model do a save() on the object, get this:

Traceback (most recent call last):

File "", line 361, in ?


File "", line 358, in Main


File "", line 328, in add_update_grouptable

File "/apps/django/lib/django/utils/", line 3, in _curried

return args[0](*(args[1:]+moreargs), dict(kwargs.items() + morekwargs.items()))

File "/apps/django/lib/django/core/meta/", line 1012, in method_save

db_values = [f.get_db_prep_save(f.pre_save(getattr(self, f.attname), True)) for f in opts.fields if not isinstance(f, AutoField)]

File "/apps/django/lib/django/core/meta/", line 725, in get_db_prep_save

return int(value)

ValueError: invalid literal for int(): xxx

From the source code in

def get_db_prep_save(self,value):

if value == or value == None:

return None


return int(value)

The above if a method from the ForeignKey field, I did pass the foreign key object to when creating the object. Please can this be fixed asap.

Change History (2)

comment:1 Changed 10 years ago by anonymous

  • Component changed from Admin interface to Core framework
  • Keywords Revision 1560 added
  • Severity changed from normal to critical
  • Version set to SVN

comment:2 Changed 10 years ago by hugo

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate to #927

Note: See TracTickets for help on using tickets.
Back to Top