aboutsummaryrefslogtreecommitdiffstats
path: root/docs/tutorial
diff options
context:
space:
mode:
authorTom Christie2013-01-20 16:38:32 +0000
committerTom Christie2013-01-20 16:38:32 +0000
commit2c76212e5454efa4d4d02c7051055c7957497d52 (patch)
treec3df35b848acf180f4f291a0647f9c8a92403e18 /docs/tutorial
parent42fcc3599c7d6aff2b50e534af4a5efbe3ce8c47 (diff)
downloaddjango-rest-framework-2c76212e5454efa4d4d02c7051055c7957497d52.tar.bz2
Add missing import to tutorial. Fixes #599
Diffstat (limited to 'docs/tutorial')
-rw-r--r--docs/tutorial/4-authentication-and-permissions.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/docs/tutorial/4-authentication-and-permissions.md b/docs/tutorial/4-authentication-and-permissions.md
index f6daebb7..35aca8c6 100644
--- a/docs/tutorial/4-authentication-and-permissions.md
+++ b/docs/tutorial/4-authentication-and-permissions.md
@@ -54,6 +54,8 @@ You might also want to create a few different users, to use for testing the API.
Now that we've got some users to work with, we'd better add representations of those users to our API. Creating a new serializer is easy:
+ from django.contrib.auth.models import User
+
class UserSerializer(serializers.ModelSerializer):
snippets = serializers.ManyPrimaryKeyRelatedField()
@@ -188,4 +190,4 @@ We've now got a fairly fine-grained set of permissions on our Web API, and end p
In [part 5][tut-5] of the tutorial we'll look at how we can tie everything together by creating an HTML endpoint for our hightlighted snippets, and improve the cohesion of our API by using hyperlinking for the relationships within the system.
-[tut-5]: 5-relationships-and-hyperlinked-apis.md \ No newline at end of file
+[tut-5]: 5-relationships-and-hyperlinked-apis.md