1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #6953 -- Correctly sort ManyToMany fields in ModelForms. Thanks, dgouldin, mk and Alex.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16063 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel
2011-04-22 12:01:33 +00:00
parent 327081f875
commit 7d11c30994
2 changed files with 34 additions and 34 deletions

View File

@@ -143,7 +143,7 @@ def fields_for_model(model, fields=None, exclude=None, widgets=None, formfield_c
field_list = []
ignored = []
opts = model._meta
for f in opts.fields + opts.many_to_many:
for f in sorted(opts.fields + opts.many_to_many):
if not f.editable:
continue
if fields is not None and not f.name in fields: