Ticket #9418: django-9418.diff
File django-9418.diff, 1.0 KB (added by , 16 years ago) |
---|
-
django/forms/models.py
41 41 raise ValueError("The %s could not be %s because the data didn't" 42 42 " validate." % (opts.object_name, fail_message)) 43 43 cleaned_data = form.cleaned_data 44 filefieldlist = [] 44 45 for f in opts.fields: 45 46 if not f.editable or isinstance(f, models.AutoField) \ 46 47 or not f.name in cleaned_data: … … 49 50 continue 50 51 if exclude and f.name in exclude: 51 52 continue 53 if isinstance(f, models.FileField) or isinstance(f, models.ImageField): 54 filefieldlist.append(f) 55 else: 56 f.save_form_data(instance, cleaned_data[f.name]) 57 58 for f in filefieldlist: 52 59 f.save_form_data(instance, cleaned_data[f.name]) 60 53 61 # Wrap up the saving of m2m data as a function. 54 62 def save_m2m(): 55 63 opts = instance._meta