Skip to content

Commit c4097e7

Browse files
committed
base pagination added for typing
1 parent e5a1237 commit c4097e7

File tree

4 files changed

+3
-0
lines changed

4 files changed

+3
-0
lines changed
190 Bytes
Binary file not shown.

djapy/core/dec.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ def _wrapped_view(request: HttpRequest, *args, **view_kwargs):
217217
schema_dict_returned = {200: schema_dict_returned}
218218

219219
if pagination_class:
220+
if not issubclass(pagination_class, BasePagination):
221+
raise TypeError(f"pagination_class should be a subclass of BasePagination, not {pagination_class}")
222+
220223
schema_dict_returned[200] = pagination_class.response[schema_dict_returned[200]]
221224
extra_query_dict = {
222225
name: (type_name_, default)
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)