Skip to content

Commit

Permalink
Add example of LazyPaginator usage
Browse files Browse the repository at this point in the history
  • Loading branch information
jieter committed Aug 24, 2018
1 parent 8f10818 commit 268e737
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions django_tables2/paginators.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ class LazyPaginator(Paginator):
"""
Implement lazy pagination, preventing any count() queries.
Usage with SingleTableView::
class UserListView(SingleTableView):
table_class = UserTable
table_data = User.objects.all()
table_pagination = {
"klass": LazyPaginator
}
"""

def __init__(self, object_list, per_page, **kwargs):
Expand Down

0 comments on commit 268e737

Please sign in to comment.