mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-14 05:36:50 +03:00
typo in fields.md
This commit is contained in:
parent
9687f4ffae
commit
0a65913fea
|
@ -461,7 +461,7 @@ This is a read-only field. It gets its value by calling a method on the serializ
|
||||||
|
|
||||||
**Signature**: `SerializerMethodField(method_name=None)`
|
**Signature**: `SerializerMethodField(method_name=None)`
|
||||||
|
|
||||||
- `method-name` - The name of the method on the serializer to be called. If not included this defaults to `get_<field_name>`.
|
- `method_name` - The name of the method on the serializer to be called. If not included this defaults to `get_<field_name>`.
|
||||||
|
|
||||||
The serializer method referred to by the `method_name` argument should accept a single argument (in addition to `self`), which is the object being serialized. It should return whatever you want to be included in the serialized representation of the object. For example:
|
The serializer method referred to by the `method_name` argument should accept a single argument (in addition to `self`), which is the object being serialized. It should return whatever you want to be included in the serialized representation of the object. For example:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user