From 2da7f5afcf1bec55e610ea43126c87c892dc92cf Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Thu, 14 Apr 2016 21:26:11 -0400 Subject: [PATCH] Removed unused ForeignObjectRel.get_choices() limit_to_currently_related argument. Unused since its introduction in dc334a2ba8dbf5134d65c97fea2785c3b2294ef5. --- django/db/models/fields/reverse_related.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/django/db/models/fields/reverse_related.py b/django/db/models/fields/reverse_related.py index 93f0d4aba0..c477ab5a93 100644 --- a/django/db/models/fields/reverse_related.py +++ b/django/db/models/fields/reverse_related.py @@ -130,8 +130,7 @@ class ForeignObjectRel(object): self.related_model._meta.model_name, ) - def get_choices(self, include_blank=True, blank_choice=BLANK_CHOICE_DASH, - limit_to_currently_related=False): + def get_choices(self, include_blank=True, blank_choice=BLANK_CHOICE_DASH): """ Return choices with a default blank choices included, for use as SelectField choices for this field. @@ -139,14 +138,9 @@ class ForeignObjectRel(object): Analog of django.db.models.fields.Field.get_choices(), provided initially for utilization by RelatedFieldListFilter. """ - first_choice = blank_choice if include_blank else [] - queryset = self.related_model._default_manager.all() - if limit_to_currently_related: - queryset = queryset.complex_filter( - {'%s__isnull' % self.related_model._meta.model_name: False} - ) - lst = [(x._get_pk_val(), smart_text(x)) for x in queryset] - return first_choice + lst + return (blank_choice if include_blank else []) + [ + (x._get_pk_val(), smart_text(x)) for x in self.related_model._default_manager.all() + ] def get_db_prep_lookup(self, lookup_type, value, connection, prepared=False): # Defer to the actual field definition for db prep