Ticket #6211: save_instance.2.diff
File save_instance.2.diff, 1.1 KB (added by , 17 years ago) |
---|
-
Users/seth/django_src/django/newforms/models.py
39 39 if not f.editable or isinstance(f, models.AutoField) \ 40 40 or not f.name in cleaned_data: 41 41 continue 42 if fields and f.name not in fields: 43 continue 42 if fields: 43 if f.name not in fields: 44 continue 44 45 f.save_form_data(instance, cleaned_data[f.name]) 45 46 # Wrap up the saving of m2m data as a function. 46 47 def save_m2m(): 47 48 opts = instance.__class__._meta 48 49 cleaned_data = form.cleaned_data 49 50 for f in opts.many_to_many: 50 if fields and f.name not in fields: 51 continue 51 if fields: 52 if f.name not in fields: 53 continue 52 54 if f.name in cleaned_data: 53 55 f.save_form_data(instance, cleaned_data[f.name]) 54 56 if commit: