mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 11:30:12 +03:00
Merge df4ed21717
into 7d64b7016d
This commit is contained in:
commit
fd64ffdf97
|
@ -312,8 +312,8 @@ The following example demonstrates how you might handle creating a user with a n
|
|||
|
||||
def create(self, validated_data):
|
||||
profile_data = validated_data.pop('profile')
|
||||
user = User.objects.create(**validated_data)
|
||||
Profile.objects.create(user=user, **profile_data)
|
||||
profile = Profile.objects.create(**profile_data)
|
||||
user = User.objects.create(profile=profile, **validated_data)
|
||||
return user
|
||||
|
||||
#### Writing `.update()` methods for nested representations
|
||||
|
|
Loading…
Reference in New Issue
Block a user