Commit 9b829bec by qwhex Committed by GitHub

Update 2-requests-and-responses.md: consistency

Made it consistent with Part I. Catched it when commiting the code into my local tutorial repo.
parent fed85bc2
...@@ -47,7 +47,7 @@ We don't need our `JSONResponse` class in `views.py` anymore, so go ahead and de ...@@ -47,7 +47,7 @@ We don't need our `JSONResponse` class in `views.py` anymore, so go ahead and de
@api_view(['GET', 'POST']) @api_view(['GET', 'POST'])
def snippet_list(request): def snippet_list(request):
""" """
List all snippets, or create a new snippet. List all code snippets, or create a new snippet.
""" """
if request.method == 'GET': if request.method == 'GET':
snippets = Snippet.objects.all() snippets = Snippet.objects.all()
...@@ -68,7 +68,7 @@ Here is the view for an individual snippet, in the `views.py` module. ...@@ -68,7 +68,7 @@ Here is the view for an individual snippet, in the `views.py` module.
@api_view(['GET', 'PUT', 'DELETE']) @api_view(['GET', 'PUT', 'DELETE'])
def snippet_detail(request, pk): def snippet_detail(request, pk):
""" """
Retrieve, update or delete a snippet instance. Retrieve, update or delete a code snippet.
""" """
try: try:
snippet = Snippet.objects.get(pk=pk) snippet = Snippet.objects.get(pk=pk)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment