Skip to content

Commit

Permalink
Add get_queryset to GenericAPIView (#26)
Browse files Browse the repository at this point in the history
~~I took this from upstream and added the Mongo part, so hopefully it's alright~~, though my knowledge of the type system is a bit more limited than I'd like.

Nevermind, I went with a simpler approach as the approach from upstream wasn't passing tests for me, not exactly sure why.
  • Loading branch information
knyghty authored Aug 12, 2022
1 parent bd19d56 commit 6565faf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rest_framework-stubs/generics.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class GenericAPIView(views.APIView):
@overload
def paginate_queryset(self, queryset: MongoQuerySet[_T]) -> Optional[List[_T]]: ...
def get_paginated_response(self, data: Any) -> Response: ...
def get_queryset(self) -> Union[QuerySet[_MT_co], MongoQuerySet[_T]]: ...

class CreateAPIView(mixins.CreateModelMixin, GenericAPIView):
def post(self, request: Request, *args: Any, **kwargs: Any) -> HttpResponse: ...
Expand Down

0 comments on commit 6565faf

Please sign in to comment.