Skip to content

Error while using StreamedPaginatedListMixin #223

@JamesMutahi

Description

@JamesMutahi

Hi. I am trying to use the StreamedPaginatedListMixin by adding the pagination class to the consumer and I get this error:

TypeError: PageNumberPagination.paginate_queryset() got an unexpected keyword argument 'request_id'

Setting the pagination globally in settings.py does not paginate.

from djangochannelsrestframework.generics import GenericAsyncAPIConsumer
from djangochannelsrestframework.mixins import (
    CreateModelMixin, PatchModelMixin, StreamedPaginatedListMixin
)
from rest_framework.pagination import PageNumberPagination

from posts.models import Post
from posts.serializers import PostSerializer, ReportSerializer

class StandardResultsSetPagination(PageNumberPagination):
    page_size = 100
    page_size_query_param = 'page_size'
    max_page_size = 1000

class PostConsumer(
    StreamedPaginatedListMixin,
    CreateModelMixin,
    PatchModelMixin,
    GenericAsyncAPIConsumer
):
    queryset = Post.objects.all()
    serializer_class = PostSerializer
    lookup_field = "pk"
    pagination_class = StandardResultsSetPagination

The whole project is here
I am trying to implement the mixin here

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions