mirror of
https://github.com/django/django.git
synced 2025-07-24 05:36:15 +00:00
Fixed #19617 -- Refactored Form metaclasses to support more inheritance scenarios.
Thanks apollo13, funkybob and mjtamlyn for the reviews.
This commit is contained in:
parent
54cd930baf
commit
ac5ec7b8bc
8 changed files with 105 additions and 42 deletions
|
@ -644,11 +644,12 @@ There are a couple of things to note, however.
|
|||
used. This means the child's ``Meta``, if it exists, otherwise the
|
||||
``Meta`` of the first parent, etc.
|
||||
|
||||
* For technical reasons, a subclass cannot inherit from both a ``ModelForm``
|
||||
and a ``Form`` simultaneously.
|
||||
.. versionchanged:: 1.7
|
||||
|
||||
Chances are these notes won't affect you unless you're trying to do something
|
||||
tricky with subclassing.
|
||||
* It's possible to inherit from both ``Form`` and ``ModelForm`` simultaneuosly,
|
||||
however, you must ensure that ``ModelForm`` appears first in the MRO. This is
|
||||
because these classes rely on different metaclasses and a class can only have
|
||||
one metaclass.
|
||||
|
||||
.. _modelforms-factory:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue