-
-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Allow http.HTTPMethod
enum values in @action()
decorator
#512
Allow http.HTTPMethod
enum values in @action()
decorator
#512
Conversation
Signed-off-by: Sergei Shishov <sshishov.sshishov@gmail.com>
4957d96
to
a25faea
Compare
Signed-off-by: Sergei Shishov <sshishov.sshishov@gmail.com>
Signed-off-by: Sergei Shishov <sshishov.sshishov@gmail.com>
Signed-off-by: Sergei Shishov <sshishov.sshishov@gmail.com>
Signed-off-by: Sergei Shishov <sshishov.sshishov@gmail.com>
We don't usually add regression tests for the more straightforward parts of type stubs. Only particularly complicated generics, decorators or |
What I have noticed, these tests are quite slow, every test is around 1 second (roughly) and therefore having a lot of tests to cover all cases (for regressing) is not quite applicable there. Regarding this point:
According to this: https://github.com/encode/django-rest-framework/blob/f378f98a401f28df4ef9bdaf3ee56a1017c195ab/rest_framework/decorators.py#L123C1-L123C1, the |
EDIT: Sorry, I noticed now I forgot to post the review that I had finished. You're getting two different things mixed up. Yes, the
But that's all moot anyway, |
…tAction` Signed-off-by: Sergei Shishov <sshishov.sshishov@gmail.com>
Signed-off-by: Sergei Shishov <sshishov.sshishov@gmail.com>
NOTE: the `Sequence` used now in place instead of adding to type alias Signed-off-by: Sergei Shishov <sshishov.sshishov@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is great. I just pushed a commit to add back a few empty lines :)
http.HTTPMethod
to action
decoratorhttp.HTTPMethod
enum values in @action()
decorator
http.HTTPMethod
enum values in @action()
decoratorhttp.HTTPMethod
enum values in @action()
decorator
As a follow-up, should we use |
Hi @intgr to be honest I do not know, but yeah, we are using it in PROD and it is working as expected |
I have made things!
Added possibility to specify
http.HTTPMethod
enum as an action's methodRelated issues
Fixes: #396
Notes for reviewer:
sys.version_Info
, just do not know if I did it right, especially in the tests. It would actually more proper to mark test as Python3.11+ only and add in that test only the line withHTTPMethod
and on previous versions this test will be just skipped. But I do not know how to do it.Sequence
for lowercase as an options foraction
specification, apparently there is no test for it. I even do not know if it is correct, will double check later ifUPPERCASE
andHTTPMethod
can be specified there. I just do not know why they are different.UPPERCASE
as it was not tested and one forHTTPMethod
Please feel free to comment and I will make appropriate changes. @intgr 🎉