Changes between Initial Version and Version 3 of Ticket #12238
- Timestamp:
- Nov 19, 2009, 3:31:21 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #12238
- Property Component Uncategorized → django.contrib.admin
-
Ticket #12238 – Description
initial v3 1 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.1 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. 2 2 3 I would expect the field to display without the coaxing in Meta.fields.3 I would expect the field to display without the coaxing in `Meta.fields`. 4 4 5 1. Create aModelForm6 2. Add it toModelAdmin7 3. View Form8 4. Update ModelForm's __init__ to include "self.fields['xyz'] = forms.CharField(max_length=255, initial='keke')" 9 5. View Form (note no change)10 6. Update ModelForm's Meta.fieldsto include "xyz"11 7. View Form (note the change)5 1. Create a !ModelForm 6 2. Add it to !ModelAdmin 7 3. View Form 8 4. Update !ModelForm's `__init__` to include `self.fields['xyz'] = forms.CharField(max_length=255, initial='keke')` 9 5. View Form (note no change) 10 6. Update !ModelForm's `Meta.fields` to include "xyz" 11 7. View Form (note the change)