diff options
| author | Tom Christie | 2014-12-06 10:14:16 +0000 |
|---|---|---|
| committer | Tom Christie | 2014-12-06 10:14:16 +0000 |
| commit | 71c49fea8abf1007d17aaf801dab9099b36515bd (patch) | |
| tree | 22bd786e186a140a7d27676d948db342f6acc560 /docs/tutorial/4-authentication-and-permissions.md | |
| parent | 544967f36ed6e29819018428d48da00de74958b9 (diff) | |
| parent | e4820d611bb17e33bf466c2a6dedcce7548d8d21 (diff) | |
| download | django-rest-framework-71c49fea8abf1007d17aaf801dab9099b36515bd.tar.bz2 | |
Merge pull request #2219 from linovia/bugfix/tutorial_2
Update the tutorial against DRF v3 (part 4 & 5)
Diffstat (limited to 'docs/tutorial/4-authentication-and-permissions.md')
| -rw-r--r-- | docs/tutorial/4-authentication-and-permissions.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/tutorial/4-authentication-and-permissions.md b/docs/tutorial/4-authentication-and-permissions.md index 4e4edeea..43c1953e 100644 --- a/docs/tutorial/4-authentication-and-permissions.md +++ b/docs/tutorial/4-authentication-and-permissions.md @@ -43,7 +43,7 @@ And now we can add a `.save()` method to our model class: When that's all done we'll need to update our database tables. Normally we'd create a database migration in order to do that, but for the purposes of this tutorial, let's just delete the database and start again. - rm tmp.db + rm -f tmp.db db.sqlite3 rm -r snippets/migrations python manage.py makemigrations snippets python manage.py migrate @@ -59,7 +59,7 @@ Now that we've got some users to work with, we'd better add representations of t from django.contrib.auth.models import User class UserSerializer(serializers.ModelSerializer): - snippets = serializers.PrimaryKeyRelatedField(many=True) + snippets = serializers.PrimaryKeyRelatedField(many=True, queryset=Snippet.objects.all()) class Meta: model = User |
