#12238: ModelAdmin ignores dynamic fields of ModelForm
------------------------------------------------+---------------------------
 Reporter:  anonymous                           |       Owner:  nobody    
   Status:  new                                 |   Milestone:            
Component:  Uncategorized                       |     Version:  1.1       
 Keywords:  modelform modeladmin dynamic field  |       Stage:  Unreviewed
Has_patch:  0                                   |  
------------------------------------------------+---------------------------
 If a ModelForm is created and then modified to programatically add fields
 (say, in __init__), ModelAdmin ignores these fields when rendering the
 form.  If one of these fields is added to the ModelForm's Meta, the field
 shows up just fine.

 I would expect the field to display without the coaxing in Meta.fields.

 1. Create a ModelForm
 2. Add it to ModelAdmin
 3. View Form
 4. Update ModelForm's __init__ to include "self.fields['xyz'] =
 forms.CharField(max_length=255, initial='keke')"
 5. View Form (note no change)
 6. Update ModelForm's Meta.fields to include "xyz"
 7. View Form (note the change)

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12238>
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 [email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=.


Reply via email to