@ -288,13 +288,16 @@ class CollectionItemViewSet(BaseViewSet):
iterator = get_object_or_404 ( queryset , uid = iterator )
iterator = get_object_or_404 ( queryset , uid = iterator )
queryset = queryset . filter ( id__lt = iterator . id )
queryset = queryset . filter ( id__lt = iterator . id )
queryset = queryset [ : limit ]
result = list ( queryset [ : limit + 1 ] )
serializer = CollectionItemRevisionSerializer ( queryset , context = self . get_serializer_context ( ) , many = True )
if len ( result ) < limit + 1 :
done = True
else :
done = False
result = result [ : - 1 ]
# This is not the most efficient way of implementing this, but it's good enough
serializer = CollectionItemRevisionSerializer ( result , context = self . get_serializer_context ( ) , many = True )
done = len ( queryset ) < limit
last_item = len ( que rys et) > 0 and serializer . data [ - 1 ]
last_item = len ( resul t) > 0 and serializer . data [ - 1 ]
ret = {
ret = {
' data ' : serializer . data ,
' data ' : serializer . data ,
@ -510,13 +513,16 @@ class InvitationBaseViewSet(BaseViewSet):
iterator = get_object_or_404 ( queryset , uid = iterator )
iterator = get_object_or_404 ( queryset , uid = iterator )
queryset = queryset . filter ( id__gt = iterator . id )
queryset = queryset . filter ( id__gt = iterator . id )
queryset = queryset [ : limit ]
result = list ( queryset [ : limit + 1 ] )
serializer = self . get_serializer ( queryset , many = True )
if len ( result ) < limit + 1 :
done = True
else :
done = False
result = result [ : - 1 ]
# This is not the most efficient way of implementing this, but it's good enough
serializer = self . get_serializer ( result , many = True )
done = len ( queryset ) < limit
last_item = len ( que rys et) > 0 and serializer . data [ - 1 ]
last_item = len ( resul t) > 0 and serializer . data [ - 1 ]
ret = {
ret = {
' data ' : serializer . data ,
' data ' : serializer . data ,