Ticket #17080: Deserializer.patch

File Deserializer.patch, 847 bytes (added by Paul Garner, 13 years ago)

fix Deserializer

  • django/core/serializers/python.py

     
    122122                        data[field.attname] = field.rel.to._meta.get_field(field.rel.field_name).to_python(field_value)
    123123                else:
    124124                    data[field.attname] = None
     125           
     126            # any custom field type where attname is different to name (and is not
     127            # caught already by checks above) needs instantiating by attname due to
     128            # the way Model.__init__ is written currently
     129            elif field.name != field.attname:
     130                data[field.attname] = field.to_python(field_value)
    125131
    126132            # Handle all other fields
    127133            else:
Back to Top