#35746: make the form.cleaned_data attribute of form available in the __init__
-------------------------------------+-------------------------------------
     Reporter:  piscvau              |                     Type:
                                     |  Cleanup/optimization
       Status:  new                  |                Component:  Forms
      Version:  5.0                  |                 Severity:  Normal
     Keywords:  clean_field_name ,   |             Triage Stage:
  form.full_clean                    |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
 Hello
 form.clean_field_name functions have no parameter passed to it as
 indicated in the documentation and need to access the form.cleaned_data
 dictionnary. However this cleaned_data dictionnary is not created in the
 __init__ of the form but only in the full_clean method of the form.

 the need:
 in the form.__init__, add closure functions as clean_field_name functions
 and use the cleaned_data dictionnary as a free variable of this closure
 function. However this is not possible because the
 cleaned_data_dictionnary is not yet created.

 Suggested patch :
 create the cleaned_data.attribute in the __init__ instead of the
 full_clean
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35746>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070191d628ed6f-74332436-b878-44e0-af44-fd2a6e9a0bb6-000000%40eu-central-1.amazonses.com.

Reply via email to