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
316b7b87
Commit
316b7b87
authored
Feb 18, 2014
by
Tom Christie
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1428 from theskumar/patch-1
fix(docs): fix code indentation in serializers.md
parents
d328f182
b3aa512d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
docs/api-guide/serializers.md
+8
-8
No files found.
docs/api-guide/serializers.md
View file @
316b7b87
...
@@ -383,14 +383,14 @@ You may wish to specify multiple fields as write-only. Instead of adding each f
...
@@ -383,14 +383,14 @@ You may wish to specify multiple fields as write-only. Instead of adding each f
fields = ('email', 'username', 'password')
fields = ('email', 'username', 'password')
write_only_fields = ('password',) # Note: Password field is write-only
write_only_fields = ('password',) # Note: Password field is write-only
def restore_object(self, attrs, instance=None):
def restore_object(self, attrs, instance=None):
"""
"""
Instantiate a new User instance.
Instantiate a new User instance.
"""
"""
assert instance is None, 'Cannot update users with CreateUserSerializer'
assert instance is None, 'Cannot update users with CreateUserSerializer'
user = User(email=attrs['email'], username=attrs['username'])
user = User(email=attrs['email'], username=attrs['username'])
user.set_password(attrs['password'])
user.set_password(attrs['password'])
return user
return user
## Specifying fields explicitly
## Specifying fields explicitly
...
...
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