django-rest-framework icon indicating copy to clipboard operation
django-rest-framework copied to clipboard

How to turn off pagination?

Open staticmetal opened this issue 11 years ago • 2 comments

I am sorry if this is a silly question. But I could not find how to disable pagination. I am using LimitOffsetPagination as my default pagination class. I was to disable pagination in some views. To disable pagination I am setting paginate_by and paginate_by_param to None. But it is not working and I am not able to find a specific solution in docs. Can you please suggest how to disable pagination on some views while using the default on others?

staticmetal avatar Mar 20 '15 06:03 staticmetal

I'm waiting for a good solution as well. But the following solution worked for me

def paginate_queryset(self, queryset, view=None):
    # couldn't find a better solution
    return None

Override paginate_queryset to return None.

Thanks Ankit

ankitpopli1891 avatar Mar 20 '15 07:03 ankitpopli1891

Setting page_size to 0 should do. Also please use the mailing list, irc or stack overflow for usage questions

xordoquy avatar Mar 20 '15 08:03 xordoquy