Search code examples
djangodjango-viewsdjango-tables2

Django-tables2 - How do I disable pagination for a SingleTableMixin,FilterView?


How can I disable pagination in FilterView?

All the commented out code is what I've already tried. None of which is working. As soon as I filter the table, the pagination appears at the bottom and part of the filtered result is not visible (unless you go to the next page)

class AlpineTableView(SingleTableMixin, FilterView):
    table_class = AlpineTable
    queryset = Artikel.objects.all()
    filterset_class = AlpineFilter

    # def get_table_pagination(self, request):
    #     return False

    # def get_table_pagination(self, table):
    #     return False

    # table_pagination = False
    # pagination_class = None
    # paginator = None

    # table_pagination = {
    #     "per_page": 100000
    # }

    template_name = "artikelen/alpine-voorraad-filter.html"

Solution

  •  SingleTableMixin.table_pagination = False
    
     class AlpineTableView(SingleTableMixin,FilterView): 
        rest of the class
    

    This works!