#13971: Excluding a declared field in ModelForm in form’s subclass
---------------------------------------------+------------------------------
          Reporter:  mitar                   |         Owner:     
            Status:  new                     |     Milestone:     
         Component:  Forms                   |       Version:  1.2
        Resolution:                          |      Keywords:     
             Stage:  Design decision needed  |     Has_patch:  0  
        Needs_docs:  0                       |   Needs_tests:  0  
Needs_better_patch:  0                       |  
---------------------------------------------+------------------------------
Changes (by matiasb):

  * owner:  matiasb =>
  * stage:  Unreviewed => Design decision needed

Comment:

 Right now, Form class (or form super class) declared fields are always
 included in the form, ignoring the Meta 'exclude' and/or 'fields'
 attributes. To solve the issue reported here, a possible approach would be
 to consider filtering out the model fields not included (or excluded) in
 Meta from the form declared fields (or should it be in the form super
 class declared fields?). However, this alternative conflicts with the fix
 for #10363 that assumes the declared form field 'name' is available in the
 form although it is excluded in the form Meta definition.

 I'm attaching a patch with tests that reproduce the issue and another
 patch that filters out excluded fields from declared fields (but make the
 doctest in #10363 fail). I think a design decision is needed here.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/13971#comment:4>
Django <http://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 post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to