Why there is no __init__
in the paginator classes??
#9424
Unanswered
ZeyadMoustafaKamal
asked this question in
Ideas & Suggestions
Replies: 1 comment 3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Well, this is weird to me as I have no idea why this hasn't already been implemented. What I mean is that it's normal to think about. Anyway let's say I want to add something like the
page_size
in thePageNumberPagination
what will I have to do ?? I will need to subclass thePageNumberPagination
or add it in the defaults in thesettings.py
but here is the problem. what if I had different pagination parameters depending on something? like the notifications, the comments, the posts ...etc. All of them will be different; this way, I will need to subclass the paginator class for every use case.So I want to do one of the two things. maybe provide a way to add some class variables in the views or viewsets that control these things or allow to pass it to the 'init' (or both) also I am ready to implement any of those and open a PR. I want your suggestions for this. what do you think??
Beta Was this translation helpful? Give feedback.
All reactions