Skip to content
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

Merged
merged 2 commits into from Mar 1, 2016

Conversation

lynndotconfig
Copy link
Contributor

@lynndotconfig lynndotconfig commented Feb 29, 2016

Description

to fix "@api_view" usage error in "docs/tutorial/5-relationships-and-hyperlinked-apis.md"

"@api_view" usage error.
@xordoquy
Copy link
Collaborator

xordoquy commented Feb 29, 2016

I don't really see what it fixes. Both tuple and lists should be valid.

@lynndotconfig
Copy link
Contributor Author

lynndotconfig commented Mar 1, 2016

If it was only passed by "GET", list is safer then tuple and also can skip the comma.

@xordoquy
Copy link
Collaborator

xordoquy commented Mar 1, 2016

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',])
Copy link
Collaborator

@xordoquy xordoquy Mar 1, 2016

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
@lynndotconfig lynndotconfig changed the title [FIX] "@api_view" calling error in docs/tutorial/5-relationships-and-hyperlinked-apis.md [change] using safer calling way of "@api_view" in docs/tutorial/5-relationships-and-hyperlinked-apis.md Mar 1, 2016
@lynndotconfig
Copy link
Contributor Author

lynndotconfig commented Mar 1, 2016

Yes, for Python newcomers.

@xordoquy xordoquy added this to the 3.4.0 Release milestone Mar 1, 2016
xordoquy added a commit that referenced this issue Mar 1, 2016
[change] using safer calling way of  "@api_view" in docs/tutorial/5-relationships-and-hyperlinked-apis.md
@xordoquy xordoquy merged commit c2cfb84 into encode:master Mar 1, 2016
2 checks passed
@xordoquy
Copy link
Collaborator

xordoquy commented Mar 1, 2016

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants