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 %}
{%
This is a very theoretical question about best practice. I and surely most
other users know how to do this in *any* way, but I'm interested in the *best
*solution, if it exists.
Given that:
- I am inheriting a given form I cannot modify directly, let's say the
AuthenticationForm
- I
I have a form class, call it MyBaseForm which defines some media as a
dynamic property (by providing a media property, not defining a Media
class). Then I have MyForm which inherits from MyBaseForm and
overrides some widgets on it's fields, these widgets have their own
media definitions. The
Lets say I have one form which inherits from ModelForm and a second
one that inherits from the first one. What I want to do is add 2
fields in the second form, the fields are bound to the properties of
the model. Which would be the best way to do this?
Example:
the model has fields: name,
On 26 Sie, 12:22, fax8 <[EMAIL PROTECTED]> wrote:
> Nobody have ideas?
I've got a similar problem, with the added fun of inheritance working
on the dev machine and not working on the production server (it used
to). Turns out I broke something and python stopped recognizing that
newforms and
Nobody have ideas?
On Aug 25, 6:28 pm, fax8 <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> anyone can tell me why the following does not works as expected?
>
> I mean why, when displaying the form with:
>
> form = RenderForm()
> return render_to_response('add_render.html', {'form': form},
>
Hi guys,
anyone can tell me why the following does not works as expected?
I mean why, when displaying the form with:
form = RenderForm()
return render_to_response('add_render.html', {'form': form},
context_instance=RequestContext(request))
the subject field is not displayed?
And why the
10 matches
Mail list logo