Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable pagination in django-tables2?

In django-tables2 I have a table which I do not want paginated. I have not specified pagination, as shown in the docs:

table.paginate(page=request.GET.get('page', 1), per_page=25)

The tables still paginate, presumably by default. The RequestConfig class docstring says to pass a false value for paginate to disable pagination but I'm fuzzy on it. Here are options I've tried in my view class:

my_table.paginate = False
RequestConfig(request).configure(my_table, paginate=False)
RequestConfig(request).configure(my_table).paginate(False)
RequestConfig(request).configure(my_table, {table.paginate:False})
RequestConfig(request).configure(my_table, {paginate:False})
RequestConfig(request).configure(my_table, {"paginate":False})
like image 746
robline Avatar asked Jan 11 '13 14:01

robline


1 Answers

You want to do:

RequestConfig(request, paginate=False).configure(my_table)
like image 163
Chad Vernon Avatar answered Oct 12 '22 01:10

Chad Vernon