Skip to content

Commit 16df453

Browse files
author
Christopher Keele
committed
Less prejudiced defaults.
1 parent b45a40e commit 16df453

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

django_tables2/views.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@ def get_table(self):
3333
Return a table object to use. The table has automatic support for
3434
sorting and pagination.
3535
"""
36+
options = {}
3637
table_class = self.get_table_class()
3738
table = table_class(self.get_table_data())
38-
RequestConfig(self.request, paginate=self.get_table_pagination()).configure(table)
39+
paginate = self.get_table_pagination()
40+
if paginate is not None:
41+
options['paginate'] = paginate
42+
RequestConfig(self.request, **options).configure(table)
3943
return table
4044

4145
def get_table_class(self):
@@ -71,7 +75,7 @@ def get_table_pagination(self):
7175
Returns pagination options: True for standard pagination (default),
7276
False for no pagination, and a dictionary for custom pagination.
7377
"""
74-
return self.table_pagination or True
78+
return self.table_pagination
7579

7680
def get_context_data(self, **kwargs):
7781
"""

0 commit comments

Comments
 (0)