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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user