diff options
| author | Tom Christie | 2014-02-18 15:15:18 +0000 |
|---|---|---|
| committer | Tom Christie | 2014-02-18 15:15:18 +0000 |
| commit | 316b7b8786ba0326a8f40f3f5912d4f9fee7f073 (patch) | |
| tree | c7c81f85fa200617be6ec33bcf6627f65b74167a /docs/api-guide | |
| parent | d328f1827dcb53a92b11f3f146bad4db3ca83d89 (diff) | |
| parent | b3aa512d35b7f3e432bb41bf9de9ac7db7a1ed4c (diff) | |
| download | django-rest-framework-316b7b8786ba0326a8f40f3f5912d4f9fee7f073.tar.bz2 | |
Merge pull request #1428 from theskumar/patch-1
fix(docs): fix code indentation in serializers.md
Diffstat (limited to 'docs/api-guide')
| -rw-r--r-- | docs/api-guide/serializers.md | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md index e8369c20..39fe61eb 100644 --- a/docs/api-guide/serializers.md +++ b/docs/api-guide/serializers.md @@ -383,14 +383,14 @@ You may wish to specify multiple fields as write-only. Instead of adding each f fields = ('email', 'username', 'password') write_only_fields = ('password',) # Note: Password field is write-only - def restore_object(self, attrs, instance=None): - """ - Instantiate a new User instance. - """ - assert instance is None, 'Cannot update users with CreateUserSerializer' - user = User(email=attrs['email'], username=attrs['username']) - user.set_password(attrs['password']) - return user + def restore_object(self, attrs, instance=None): + """ + Instantiate a new User instance. + """ + assert instance is None, 'Cannot update users with CreateUserSerializer' + user = User(email=attrs['email'], username=attrs['username']) + user.set_password(attrs['password']) + return user ## Specifying fields explicitly |
