Commit af3fd098 by Tom Christie

Tweak imports in tutorial. Fixes #597.

parent a98049c5
...@@ -109,7 +109,7 @@ The first thing we need to get started on our Web API is provide a way of serial ...@@ -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 django.forms import widgets
from rest_framework import serializers from rest_framework import serializers
from snippets import models from snippets.models import Snippet
class SnippetSerializer(serializers.Serializer): 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 ...@@ -138,7 +138,7 @@ The first thing we need to get started on our Web API is provide a way of serial
return instance return instance
# Create new 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. 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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment