I have been working with Django for several years and just discovered this gem 
in the documentation (emphasis mine):

https://docs.djangoproject.com/en/1.11/ref/forms/validation/#cleaning-and-validating-fields-that-depend-on-each-other
"If your form inherits another that doesn't return a cleaned_data dictionary in 
its clean() method (doing so is optional), then don't assign cleaned_data to 
the result of the super() call and use self.cleaned_data instead:"

I had always assumed that the clean method was required return the cleaned_data 
because I thought I had read that elsewhere.  Upon further investigation, I 
discovered that this requirement was changed in Django 1.7.  Any idea why?  (I 
obviously missed reading about that change.)  It does seem somewhat 
inconsistent since the clean_field methods all require the cleaned_data of the 
field to be returned.

I've been working on a formset and was used to the behavior of the super clean 
method always returning the cleaned_data dictionary.  ...but, it doesn't, and 
I've spent a great deal of time troubleshooting this issue believing otherwise. 
 I was wondering if we could/should ask the Django developers to return the 
cleaned_data in the formset classes since they do return cleaned_data in the 
form classes.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b2ec34cd647647ca807a284e424a57bc%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.

Reply via email to