Ticket #8562: 8562_onetoone_attname.diff

File 8562_onetoone_attname.diff, 534 bytes (added by magneto, 16 years ago)

set both the attname and name for onetoonefields

  • django/forms/models.py

     
    117117                data[f.name] = [obj.pk for obj in f.value_from_object(instance)]
    118118        elif isinstance(f, OneToOneField):
    119119            data[f.attname] = f.value_from_object(instance)
     120            data[f.name] = data[f.attname]
    120121        else:
    121122            data[f.name] = f.value_from_object(instance)
    122123    return data
Back to Top