Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added compatibility with django-pagination #58

Closed
wants to merge 1 commit into from

Conversation

nqnwebs
Copy link

@nqnwebs nqnwebs commented Aug 22, 2012

By default, django-filter doesn't work well with django-pagination . There is a trick to do this [1], but this breaks the polimorphism of "object_list" (needed when use the same template sometimes with a FilterSet and sometime with a standard queryset).

[1] #13

Defining this couple of methods as a fallback to the inner qs, it works out of the box without custom django-pagination syntax.

By default, django-filter doesn't work well with django-pagination . There is a trick to do this [1], but this breaks the polimorphism of "object_list" (needed  when use the same template sometimes with a  FilterSet and some as a standard queryset). 

[1] carltongibson#13

Defining this couple of methods as a fallback to the inner qs, it works out of the box without custom django-pagination syntax.
@@ -215,6 +215,14 @@ def __init__(self, data=None, queryset=None, prefix=None):
def __iter__(self):
for obj in self.qs:
yield obj

def __len__(self):
# compatibility with django-pagination
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please remove this comment and the comment below? I think support len and getitem makes sense for more than just django-pagination.

@tomchristie
Copy link
Contributor

Issue can be closed - fixed in #59.

@apollo13 apollo13 closed this Sep 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants