#14082: modelform_factory should use the form's metaclass
---------------------------------+------------------------------------------
Reporter: jspiros | Owner: nobody
Status: new | Milestone:
Component: Forms | Version: SVN
Resolution: | Keywords: ModelForm,
ModelFormMetaclass, modelform_factory
Stage: Unreviewed | Has_patch: 1
Needs_docs: 0 | Needs_tests: 1
Needs_better_patch: 0 |
---------------------------------+------------------------------------------
Comment (by jspiros):
Replying to [comment:1 mitar]:
> I am not sure that this is the case. I play a lot with metaclasses
[comment:ticket:7018:9 here] and it seems to work?
Metaclasses work, but only if you directly instantiate the ModelForm
subclass yourself. modelform_factory dynamically creates a new form class
with the passed-in class as the parent, and uses ModelFormMetaclass as the
constructor. So, when using modelform_factory with ModelForm subclasses
that have a custom metaclass set, that custom metaclass is ignored.
--
Ticket URL: <http://code.djangoproject.com/ticket/14082#comment:2>
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].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.