diff options
| author | Tom Christie | 2013-01-19 15:31:21 +0000 |
|---|---|---|
| committer | Tom Christie | 2013-01-19 15:31:21 +0000 |
| commit | af3fd098459fb559788735cb6b49a7108e11b18e (patch) | |
| tree | 6039587cd6d64bab007c2e02fd6dcebdbb9fb384 /docs/tutorial | |
| parent | a98049c5de9a4ac9e93eac9798e00df9c93caf81 (diff) | |
| download | django-rest-framework-af3fd098459fb559788735cb6b49a7108e11b18e.tar.bz2 | |
Tweak imports in tutorial. Fixes #597.
Diffstat (limited to 'docs/tutorial')
| -rw-r--r-- | docs/tutorial/1-serialization.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/tutorial/1-serialization.md b/docs/tutorial/1-serialization.md index d3ada9e3..f5ff167f 100644 --- a/docs/tutorial/1-serialization.md +++ b/docs/tutorial/1-serialization.md @@ -109,7 +109,7 @@ The first thing we need to get started on our Web API is provide a way of serial from django.forms import widgets from rest_framework import serializers - from snippets import models + from snippets.models import Snippet class SnippetSerializer(serializers.Serializer): @@ -138,7 +138,7 @@ The first thing we need to get started on our Web API is provide a way of serial return instance # Create new instance - return models.Snippet(**attrs) + return Snippet(**attrs) The first part of serializer class defines the fields that get serialized/deserialized. The `restore_object` method defines how fully fledged instances get created when deserializing data. |
