mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #8651: correctly deserialize objects with 0 for pk/fk.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8676 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -84,7 +84,7 @@ def Deserializer(object_list, **options):
|
||||
|
||||
# Handle FK fields
|
||||
elif field.rel and isinstance(field.rel, models.ManyToOneRel):
|
||||
if field_value:
|
||||
if field_value is not None:
|
||||
data[field.attname] = field.rel.to._meta.get_field(field.rel.field_name).to_python(field_value)
|
||||
else:
|
||||
data[field.attname] = None
|
||||
|
||||
Reference in New Issue
Block a user