Re: Form Inheritance. Order is Reversed.

2017-01-11 Thread Justin J
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)

Re: Form Inheritance. Order is Reversed.

2017-01-10 Thread Justin J
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

RE: Form Inheritance. Order is Reversed.

2017-01-10 Thread Matthew Pava
[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

Form Inheritance. Order is Reversed.

2017-01-09 Thread Justin J
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 %} {%

Form Inheritance best Practice: Manipulating Fields of the Base Class

2012-11-05 Thread sbrandt
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

A question about form inheritance and form media as a dynamic property

2010-05-25 Thread Vasil Vangelovski
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

A question about model form inheritance

2009-10-04 Thread Vasil Vangelovski
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,

Re: form inheritance

2008-09-03 Thread Baczek
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

Re: form inheritance

2008-08-26 Thread fax8
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}, >

form inheritance

2008-08-25 Thread fax8
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