diff options
| author | Tom Christie | 2013-01-26 21:37:43 +0000 |
|---|---|---|
| committer | Tom Christie | 2013-01-26 21:37:43 +0000 |
| commit | b5d8f50f9dcace3ad3c708ed518f23ff260f6bea (patch) | |
| tree | 7a0fb931ad5841b863359719075dd55f8370b3a1 /docs/tutorial/1-serialization.md | |
| parent | 4eb5861f3676781493af29f8e9fd87ec22e591aa (diff) | |
| parent | a75db4cfb8ed756c451bfda7ea0c73a73859216f (diff) | |
| download | django-rest-framework-b5d8f50f9dcace3ad3c708ed518f23ff260f6bea.tar.bz2 | |
Merge branch 'master' into many-fields
Diffstat (limited to 'docs/tutorial/1-serialization.md')
| -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. |
