-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[change] using safer calling way of "@api_view" in docs/tutorial/5-relationships-and-hyperlinked-apis.md #3971
Conversation
"@api_view" usage error.
I don't really see what it fixes. Both tuple and lists should be valid. |
If it was only passed by "GET", list is safer then tuple and also can skip the comma. |
ok, so it's not a fix in itself, just a change to make it safer for Python newcomers. |
@@ -11,7 +11,7 @@ Right now we have endpoints for 'snippets' and 'users', but we don't have a sing | |||
from rest_framework.reverse import reverse | |||
|
|||
|
|||
@api_view(('GET',)) | |||
@api_view(['GET',]) |
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.
Can you remove the coma here to avoid confusion with tuples ?
remove comma
Yes, for Python newcomers. |
[change] using safer calling way of "@api_view" in docs/tutorial/5-relationships-and-hyperlinked-apis.md
Thanks ! |
Description
to fix "@api_view" usage error in "docs/tutorial/5-relationships-and-hyperlinked-apis.md"