diff options
| author | Tom Christie | 2014-12-05 13:07:48 +0000 |
|---|---|---|
| committer | Tom Christie | 2014-12-05 13:07:48 +0000 |
| commit | 78f5bcb5cbc9cbed6c335734e81714bc2daa294a (patch) | |
| tree | 87f9d93a938c47e7cfa4b8c60a1c9f4ec75fcc6b /api-guide/serializers/index.html | |
| parent | 6cce0681a9da20f46f57aa2c19796b4266c3d505 (diff) | |
| download | django-rest-framework-78f5bcb5cbc9cbed6c335734e81714bc2daa294a.tar.bz2 | |
Update documentation
Diffstat (limited to 'api-guide/serializers/index.html')
| -rw-r--r-- | api-guide/serializers/index.html | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/api-guide/serializers/index.html b/api-guide/serializers/index.html index 75c3f454..08a68bb0 100644 --- a/api-guide/serializers/index.html +++ b/api-guide/serializers/index.html @@ -807,9 +807,9 @@ serializer.errors # would need to be handled. profile = instance.profile - user.username = validated_data.get('username', instance.username) - user.email = validated_data.get('email', instance.email) - user.save() + instance.username = validated_data.get('username', instance.username) + instance.email = validated_data.get('email', instance.email) + instance.save() profile.is_premium_member = profile_data.get( 'is_premium_member', @@ -821,7 +821,7 @@ serializer.errors ) profile.save() - return user + return instance </code></pre> <p>Because the behavior of nested creates and updates can be ambiguous, and may require complex dependancies between related models, REST framework 3 requires you to always write these methods explicitly. The default <code>ModelSerializer</code> <code>.create()</code> and <code>.update()</code> methods do not include support for writable nested representations.</p> <p>It is possible that a third party package, providing automatic support some kinds of automatic writable nested representations may be released alongside the 3.1 release.</p> |
