diff options
| author | Saurabh Kumar | 2014-02-18 20:39:39 +0530 |
|---|---|---|
| committer | Saurabh Kumar | 2014-02-18 20:39:39 +0530 |
| commit | b3aa512d35b7f3e432bb41bf9de9ac7db7a1ed4c (patch) | |
| tree | c7c81f85fa200617be6ec33bcf6627f65b74167a /docs/api-guide/serializers.md | |
| parent | d328f1827dcb53a92b11f3f146bad4db3ca83d89 (diff) | |
| download | django-rest-framework-b3aa512d35b7f3e432bb41bf9de9ac7db7a1ed4c.tar.bz2 | |
fix(docs): fix code indentation in serializers.md
It fixes the indentation of `restore_object()` in the section "Specifying which fields should be write-only" serializers documentation.
Diffstat (limited to 'docs/api-guide/serializers.md')
| -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 |
