Code

Ticket #4553: save_instance-patch.patch

File save_instance-patch.patch, 508 bytes (added by shaunc <shaun@…>, 7 years ago)

patch w/ fix

  • models.py

     
    3333            continue 
    3434        if fields and f.name not in fields: 
    3535            continue 
    36         setattr(instance, f.name, cleaned_data[f.name]) 
     36        attname = opts.get_field( f.name ).get_attname() 
     37        setattr(instance, attname, cleaned_data[f.name] ) 
    3738    if commit: 
    3839        instance.save() 
    3940        for f in opts.many_to_many: