mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-30 05:24:00 +03:00
Missing the source=
keyword for the URLField parameter
This commit is contained in:
parent
c94b354efa
commit
dc72fb4746
|
@ -57,7 +57,7 @@ Note that setting a `default` value implies that the field is not required. Incl
|
||||||
|
|
||||||
### `source`
|
### `source`
|
||||||
|
|
||||||
The name of the attribute that will be used to populate the field. May be a method that only takes a `self` argument, such as `URLField('get_absolute_url')`, or may use dotted notation to traverse attributes, such as `EmailField(source='user.email')`.
|
The name of the attribute that will be used to populate the field. May be a method that only takes a `self` argument, such as `URLField(source='get_absolute_url')`, or may use dotted notation to traverse attributes, such as `EmailField(source='user.email')`.
|
||||||
|
|
||||||
The value `source='*'` has a special meaning, and is used to indicate that the entire object should be passed through to the field. This can be useful for creating nested representations, or for fields which require access to the complete object in order to determine the output representation.
|
The value `source='*'` has a special meaning, and is used to indicate that the entire object should be passed through to the field. This can be useful for creating nested representations, or for fields which require access to the complete object in order to determine the output representation.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user