diff options
Diffstat (limited to 'django/db/models/fields/__init__.py')
| -rw-r--r-- | django/db/models/fields/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index 04c7f002bc..fc4966c8b7 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -807,7 +807,7 @@ class Field(RegisterLookupMixin): return return_None return str # return empty string - def get_choices(self, include_blank=True, blank_choice=BLANK_CHOICE_DASH, limit_choices_to=None): + def get_choices(self, include_blank=True, blank_choice=BLANK_CHOICE_DASH, limit_choices_to=None, ordering=()): """ Return choices with a default blank choices included, for use as <select> choices for this field. @@ -828,7 +828,7 @@ class Field(RegisterLookupMixin): ) return (blank_choice if include_blank else []) + [ (choice_func(x), str(x)) - for x in rel_model._default_manager.complex_filter(limit_choices_to) + for x in rel_model._default_manager.complex_filter(limit_choices_to).order_by(*ordering) ] def value_to_string(self, obj): |
