fengsp / django-grpc-framework

gRPC for Django.
https://djangogrpcframework.readthedocs.io/
Apache License 2.0
390 stars 52 forks source link

How to use paging queries? #47

Open lzy350593418 opened 1 year ago

lzy350593418 commented 1 year ago

class ListModelMixin: def List(self, request, context): """ List a queryset. This sends a sequence of messages of serializer.Meta.proto_class to the client.

    .. note::

        This is a server streaming RPC.
    """
    queryset = self.filter_queryset(self.get_queryset())
    serializer = self.get_serializer(queryset, many=True)
    for message in serializer.message:
        yield message
lzy350593418 commented 1 year ago

Oh, i rewrite the List function, paging queries successfully