mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
Update fields.md
obj.__class__ will return the actual Class object, we want to serialise a string (accessed with obj.__class__.__name__)
This commit is contained in:
parent
dd2e950cde
commit
680fabe9dd
|
@ -347,7 +347,7 @@ As an example, let's create a field that can be used represent the class name of
|
|||
"""
|
||||
Serialize the object's class name.
|
||||
"""
|
||||
return obj.__class__
|
||||
return obj.__class__.__name__
|
||||
|
||||
# Third party packages
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user