Fixed #19617 -- Refactored Form metaclasses to support more inheritance scenarios.

Thanks apollo13, funkybob and mjtamlyn for the reviews.
This commit is contained in:
Loic Bistuer 2013-07-21 02:25:27 +07:00
parent 54cd930baf
commit ac5ec7b8bc
8 changed files with 105 additions and 42 deletions

View file

@ -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: