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
fdd35cd2
Commit
fdd35cd2
authored
Jan 27, 2013
by
Tom Christie
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #621 from mktums/patch-1
Update docs/tutorial/1-serialization.md
parents
a58145e2
c1dc1860
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
docs/tutorial/1-serialization.md
+6
-6
No files found.
docs/tutorial/1-serialization.md
View file @
fdd35cd2
...
...
@@ -129,12 +129,12 @@ The first thing we need to get started on our Web API is provide a way of serial
Create or update a new snippet instance.
"""
if instance:
# Update existing instance
instance.title = attrs
['title']
instance.code = attrs
['code']
instance.linenos = attrs
['linenos']
instance.language = attrs
['language']
instance.style = attrs
['style']
# Update existing instance
or part of it
instance.title = attrs
.get('title', instance.title)
instance.code = attrs
.get('code', instance.code)
instance.linenos = attrs
.get('linenos', instance.linenos)
instance.language = attrs
.get('language', instance.language)
instance.style = attrs
.get('style', instance.style)
return instance
# Create new instance
...
...
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