docs: add docstring for the paginator property override

This commit is contained in:
Glib Glugovskiy
2023-11-20 22:39:48 +02:00
parent ee4b92ca10
commit 95fcb124dd

View File

@@ -385,6 +385,11 @@ class UserCourseEnrollmentsList(generics.ListAPIView):
# pylint: disable=attribute-defined-outside-init
@property
def paginator(self):
"""
Overrides API View paginator property to dynamically determine pagination class
based on the provided api_version. Implements solutions from the discussion at
https://www.github.com/encode/django-rest-framework/issues/6397.
"""
super().paginator # pylint: disable=expression-not-assigned
api_version = self.kwargs.get('api_version')