Ticket #2921: deserialize_null.diff

File deserialize_null.diff, 645 bytes (added by mir@…, 18 years ago)

promised patch

  • django/core/serializers/python.py

    a b def Deserializer(object_list, **options)  
    7676                m2m_data[field.name] = field.rel.to._default_manager.in_bulk(field_value).values()
    7777               
    7878            # Handle FK fields
    79             elif field.rel and isinstance(field.rel, models.ManyToOneRel):
     79            elif field.rel and isinstance(field.rel, models.ManyToOneRel) and field_value!=None:
    8080                try:
    8181                    data[field.name] = field.rel.to._default_manager.get(pk=field_value)
    8282                except field.rel.to.DoesNotExist:
Back to Top