set limit to limitoffset pagination in django rest framework -


i want set limit items in django rest framework using class attributes. before posting question i have tried googling 30 mins achieve this, without luck. have gone through many so posts this, this , this , of course, have gone through drf docs on pagination many times. viewset looks below after aggressively trying achieve limited queryset.

class myviewset(listapiview):     serializer_class = myserializer     queryset = mine.objects.all()     pagination_class = limitoffsetpagination     default_limit = 2     paginate_by = 2     max_limit = 2     limit = 2     max_paginate_by = 2     page_size = 2     paginate_by_param = 2 

i know many of these attributes not needed, wanted try out luck. please note have tried listmodelmixin , not working me. overrode list() also. could not set limit queryset unless limit , offset provided. doing wrong or queryset meant limited using limit , offset?

tia


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -