Re: Model Form Field Ordering

2009-02-04 Thread Alex Koshelev
The is no public/documented API for reorder fields, but you can do some trick with SortedDict: class MyModelForm(forms.ModelForm): mySpecialField = forms.ChoiceField(label='Special', choices=(('a','aa'))) class Meta: model = MyModelType MyModelForm.base_fields.keyOrder = ["mySpecialF

Re: Model Form Field Ordering

2009-02-04 Thread Karen Tracey
On Thu, Feb 5, 2009 at 1:14 AM, Brian wrote: > > I have a ModelForm subclass where I define a special field. How do I > make that special field appear first in the rendered form (using a > form.as_* method)? > > Here is an example: > > class MyModelForm(forms.ModelForm): >mySpecialField = for

Model Form Field Ordering

2009-02-04 Thread Brian
I have a ModelForm subclass where I define a special field. How do I make that special field appear first in the rendered form (using a form.as_* method)? Here is an example: class MyModelForm(forms.ModelForm): mySpecialField = forms.ChoiceField(label='Special', choices=(('a', 'aa'))) cl