mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-18 04:02:35 +03:00
Update serializers.md
Corrected class name in example
This commit is contained in:
parent
4bbfa8d455
commit
f1fee7a4cc
|
@ -382,7 +382,7 @@ For example, suppose we wanted to ensure that `User` instances and `Profile` ins
|
|||
This manager class now more nicely encapsulates that user instances and profile instances are always created at the same time. Our `.create()` method on the serializer class can now be re-written to use the new manager method.
|
||||
|
||||
def create(self, validated_data):
|
||||
return User.objects.create(
|
||||
return UserManager.objects.create(
|
||||
username=validated_data['username'],
|
||||
email=validated_data['email'],
|
||||
is_premium_member=validated_data['profile']['is_premium_member'],
|
||||
|
|
Loading…
Reference in New Issue
Block a user