For anyone interested,
In django/django/forms/forms.py ln 45:
# Walk through the MRO.
declared_fields = OrderedDict()
for base in reversed(new_class.__mro__):
# Collect fields from base class.
if hasattr(base, 'declared_fields'):
declared_fields.update(base.declared_fields)
Thanks Mathew,
I do have multiple forms, and that is why the nested loop.
I'm going to try to upgrade to the latest 1.10 and see if it solves the
problem. If anything I will be able to use the field_order attribute.
I reverted to a commit before I upgraded from 1.5 to 1.8 and the problem
was
[mailto:django-users@googlegroups.com] On
Behalf Of Justin J
Sent: Monday, January 9, 2017 11:18 AM
To: Django users
Subject: Form Inheritance. Order is Reversed.
I have a form which is sublassing 3 forms, and has no new fields.
class D(A, B, C):
pass
form class B is subclassing 2 forms.
class B(B1
I have a form which is sublassing 3 forms, and has no new fields.
class D(A, B, C):
pass
form class B is subclassing 2 forms.
class B(B1, B2):
pass
In the template I am looping through the form.
{% for d in forms.myforms %}
{% for field in d.form.visible_fields %}
{%
4 matches
Mail list logo