﻿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
14340	Ordering ModelAdmin form fields	Alexandru Plugaru	nobody	"In order to create an custom ordering of ModelAdmin.form fields I had to do something like this:
{{{
class my_form(forms.ModelForm):
    def __init__(self, *args, **kwargs):
        super(CandidateAdminForm, self).__init__(*args, **kwargs)
        self.fields = order_fields(self.fields) #Order fields in the desired fashion.

class my_admin(admin.ModelAdmin):
    form = my_form
    exclude=('field1', )
 
    @property
    def declared_fieldsets(self):
        fields = filter(lambda item: item not in self.exclude,
                        self.form().fields.keys())
        return ((None, {'fields': fields},),)

}}}

I do not think that such a trivial task should go through such a 'hack'. Can someone point out an easier solution to achieve the same thing?"		closed	contrib.admin	1.2		invalid	forms fields		Unreviewed	0	0	0	0	0	0
