diff --git a/django_filters/filterset.py b/django_filters/filterset.py index 00c5f936b..e11bb58b6 100644 --- a/django_filters/filterset.py +++ b/django_filters/filterset.py @@ -10,7 +10,6 @@ from django.db.models.constants import LOOKUP_SEP from django.db.models.fields.related import ForeignObjectRel from django.utils import six -from django.utils.translation import ugettext as _ from .conf import settings from .compat import remote_field, remote_queryset @@ -235,12 +234,10 @@ def __init__(self, data=None, queryset=None, prefix=None, strict=None, request=N self.request = request self.filters = copy.deepcopy(self.base_filters) - # propagate the model being used through the filters + for filter_ in self.filters.values(): + # propagate the model and filterset to the filters filter_.model = self._meta.model - - # Apply the parent to the filters, this will allow the filters to access the filterset - for filter_key, filter_ in six.iteritems(self.filters): filter_.parent = self @property