-
Notifications
You must be signed in to change notification settings - Fork 97
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
Update more-views-and-viewsets.rst #68
base: master
Are you sure you want to change the base?
Conversation
Fixed several grammatical typos and reword the section on combining `PollList` and `PollDetail` to a viewset for clarity.
- :code:`/polls/<pk>/choices/` to GET the choices for a specific poll, and to create choices for a specific poll. (Idenitfied by the :code:`<pk>`) | ||
- :code:`/polls/<pk>/choices/<choice_pk>/vote/` - To vote for the choice identified by :code:`<choice_pk>` under poll with :code:`<pk>`. | ||
- :code:`/polls/<pk>/choices/` - to GET the choices for a specific poll, and to create choices for a specific poll. (Identified by the :code:`<pk>`) | ||
- :code:`/polls/<pk>/choices/<choice_pk>/vote/` - to vote for the choice identified by :code:`<choice_pk>` under poll with :code:`<pk>`. |
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.
Adding just the -
doesn't make sense. Indent the code for better readability.
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.
Something like this:
- :code:`/polls/<pk>/choices/` - to GET the choices for a specific poll, and to create choices for a specific poll. (Identified by the :code:`<pk>`)
- :code:`/polls/<pk>/choices/<choice_pk>/vote/` - to vote for the choice identified by :code:`<choice_pk>` under poll with :code:`<pk>`.
```py | ||
class PollList(generics.ListCreateAPIView): | ||
queryset = Poll.objects.all() | ||
serializer_class = PollSerializer | ||
|
||
|
||
class PollDetail(generics.RetrieveDestroyAPIView): | ||
queryset = Poll.objects.all() | ||
serializer_class = PollSerializer | ||
``` |
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.
This is a generic view, not viewset. Please revert
Fixed several grammatical typos and reword the section on combining
PollList
andPollDetail
to a viewset for clarity.