﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
8164	Custom field order in ModelForms	killiands	Alex Gaynor	"When deriving forms from models it may be wanted to have a custom ordering and intertwine extra fields with the predefined model fields. Accompanied patch allows this:

Example given:
{{{
class UserForm(forms.ModelForm):
    password = forms.CharField(label=_('password'), widget=forms.PasswordInput)
    password2 = forms.CharField(label=_('repeat password'), widget=forms.PasswordInput)
    email2 = forms.EmailField(label=_('repeat email'))
    
    class Meta:
        model = User
        fields = ('username', 'first_name', 'last_name', 'password', 'password2', 'email', 'email2')
}}}

As you can see you can both define model fields and custom fields in the meta class and now the form will use that order instead of the model order followed by custom fields."	Uncategorized	closed	Forms	dev	Normal	fixed	modelform, field order	django@… steven@… marco@…	Accepted	1	0	0	0	0	0
