#12238: ModelAdmin ignores dynamic fields of ModelForm
-------------------------------------------+--------------------------------
Reporter: anonymous | Owner: nobody
Status: new | Milestone:
Component: django.contrib.admin | Version: 1.1
Resolution: | Keywords: modelform
modeladmin dynamic field
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
-------------------------------------------+--------------------------------
Changes (by anonymous):
* needs_better_patch: => 0
* component: Uncategorized => django.contrib.admin
* needs_tests: => 0
* needs_docs: => 0
Comment:
I've solved this in the meantime by updating contrib/admin/options.py in:
{{{
def get_fieldsets(self, request, obj=None):
"Hook for specifying fieldsets for the add form."
if self.declared_fieldsets:
return self.declared_fieldsets
#form = self.get_form(request, obj)
#return [(None, {'fields': form.base_fields.keys()})]
form = self.get_form(request, obj)(instance=obj)
return [(None, {'fields': form.fields.keys()})]
}}}
Seems to be a harmless fix, possible to get this applied upstream?
--
Ticket URL: <http://code.djangoproject.com/ticket/12238#comment:1>
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=.