Ticket #3370: models.py.2.diff
File models.py.2.diff, 689 bytes (added by , 18 years ago) |
---|
-
django/newforms/models.py
29 29 opts = instance.__class__._meta 30 30 if form.errors: 31 31 raise ValueError("The %s could not be changed because the data didn't validate." % opts.object_name) 32 clean_data = form.clean_data 32 clean_data = dict([ 33 (k, (isinstance(v, unicode) and (lambda: v.encode(settings.DEFAULT_CHARSET)) or (lambda: v)()) 34 for k, v in form.clean_data.items() 35 ]) 33 36 for f in opts.fields: 34 37 if isinstance(f, models.AutoField): 35 38 continue