aboutsummaryrefslogtreecommitdiffstats
path: root/docs/tutorial/2-requests-and-responses.md
diff options
context:
space:
mode:
authorTom Christie2012-09-17 20:19:45 +0100
committerTom Christie2012-09-17 20:19:45 +0100
commit308677037f1b1f2edbd2527beac8505033c98bdc (patch)
treeca71c4429058c769dd17283a4da75d9a01409fce /docs/tutorial/2-requests-and-responses.md
parent549ebdc1c67c20bdff39a2f4a59012dd010213a1 (diff)
downloaddjango-rest-framework-308677037f1b1f2edbd2527beac8505033c98bdc.tar.bz2
Tweak docs, fix .error_data -> .errors
Diffstat (limited to 'docs/tutorial/2-requests-and-responses.md')
-rw-r--r--docs/tutorial/2-requests-and-responses.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/tutorial/2-requests-and-responses.md b/docs/tutorial/2-requests-and-responses.md
index 2c11d5ef..ffc5f269 100644
--- a/docs/tutorial/2-requests-and-responses.md
+++ b/docs/tutorial/2-requests-and-responses.md
@@ -61,7 +61,7 @@ We don't need our `JSONResponse` class anymore, so go ahead and delete that. On
comment.save()
return Response(serializer.data, status=status.HTTP_201_CREATED)
else:
- return Response(serializer.error_data, status=status.HTTP_400_BAD_REQUEST)
+ return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
Our instance view is an improvement over the previous example. It's a little more concise, and the code now feels very similar to if we were working with the Forms API. We're also using named status codes, which makes the response meanings more obvious.
@@ -87,7 +87,7 @@ Our instance view is an improvement over the previous example. It's a little mo
comment.save()
return Response(serializer.data)
else:
- return Response(serializer.error_data, status=status.HTTP_400_BAD_REQUEST)
+ return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
elif request.method == 'DELETE':
comment.delete()