Skip to content

Commit

Permalink
Remove duplicate loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan P Kilby committed Nov 7, 2016
1 parent da3ed3b commit 62516ad
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions django_filters/filterset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 62516ad

Please sign in to comment.