1
0
mirror of https://github.com/django/django.git synced 2025-07-05 10:19:20 +00:00

Fix for null values in foreign keys. Thanks Andreas.

git-svn-id: http://code.djangoproject.com/svn/django/branches/new-admin@866 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Robert Wittams 2005-10-14 20:00:17 +00:00
parent a122c04d47
commit e15c4832f5

View File

@ -656,13 +656,10 @@ class ForeignKey(Field):
return [formfields.IntegerField] return [formfields.IntegerField]
def get_db_prep_save(self,value): def get_db_prep_save(self,value):
try: if value == '' or value == None:
if value == '' or None:
return None return None
else: else:
return int(value) return int(value)
except Exception, e:
print "name: %s val: %s" % (self.name, value)
def flatten_data(self, obj = None): def flatten_data(self, obj = None):
if not obj: if not obj: