문제

In 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})
도움이 되었습니까?

해결책

You want to do:

RequestConfig(request, paginate=False).configure(my_table)

다른 팁

If you are working with class based views of Django, just override the get_table_pagination method in your view class and get_caption_display method in table class:

class YourView(SingleTableMixin, generic.TemplateView):
    def get_table_pagination(self):
        return False

In your table class,

class YourTable(Table):
    def get_caption_display(self):
        return False
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top