Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
5ff62af9
Commit
5ff62af9
authored
Feb 14, 2013
by
Stephan Groß
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #658 from eofs/doc-serializer-fix
Tutorial is missing an imports
parents
84f05975
34145408
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
docs/tutorial/1-serialization.md
+3
-3
No files found.
docs/tutorial/1-serialization.md
View file @
5ff62af9
...
@@ -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.models import Snippet
from snippets.models import Snippet
, LANGUAGE_CHOICES, STYLE_CHOICES
class SnippetSerializer(serializers.Serializer):
class SnippetSerializer(serializers.Serializer):
...
@@ -119,9 +119,9 @@ The first thing we need to get started on our Web API is provide a way of serial
...
@@ -119,9 +119,9 @@ The first thing we need to get started on our Web API is provide a way of serial
code = serializers.CharField(widget=widgets.Textarea,
code = serializers.CharField(widget=widgets.Textarea,
max_length=100000)
max_length=100000)
linenos = serializers.BooleanField(required=False)
linenos = serializers.BooleanField(required=False)
language = serializers.ChoiceField(choices=
models.
LANGUAGE_CHOICES,
language = serializers.ChoiceField(choices=LANGUAGE_CHOICES,
default='python')
default='python')
style = serializers.ChoiceField(choices=
models.
STYLE_CHOICES,
style = serializers.ChoiceField(choices=STYLE_CHOICES,
default='friendly')
default='friendly')
def restore_object(self, attrs, instance=None):
def restore_object(self, attrs, instance=None):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment