Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-fs committed Sep 21, 2018
1 parent 48edb7c commit 61bf8b1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion django_filters/filterset.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,19 @@ def qs(self):
# else STRICTNESS.IGNORE... ignoring

# start with all the results and filter from there
qs = self.queryset.all()
qs = self.queryset
# if qs is a Manager, start a Queryset
if isinstance(self.queryset, models.Manager):
qs = qs.all()

for name, filter_ in six.iteritems(self.filters):
value = self.form.cleaned_data.get(name)

if value is not None: # valid & clean data
# undocumented method to treat the current and next filter
# as a single filter.
# https://blog.ionelmc.ro/2014/05/10/django-sticky-queryset-filters/
# https://github.com/carltongibson/django-filter/pull/753
qs = qs._next_is_sticky()
qs = filter_.filter(qs, value)

Expand Down

0 comments on commit 61bf8b1

Please sign in to comment.