diff options
| author | Tom Christie | 2013-04-30 08:24:33 +0100 |
|---|---|---|
| committer | Tom Christie | 2013-04-30 08:24:33 +0100 |
| commit | 21ae3a66917acf4ea57e8f7940ce1a6823a2ce92 (patch) | |
| tree | bd4cef8d397b6a51ca2eae044b0f042949c92acc /docs/api-guide/serializers.md | |
| parent | 81c3b4f250e389c29bdaa7da07c4860e2175136d (diff) | |
| download | django-rest-framework-21ae3a66917acf4ea57e8f7940ce1a6823a2ce92.tar.bz2 | |
Drop out attribute
Diffstat (limited to 'docs/api-guide/serializers.md')
| -rwxr-xr-x | docs/api-guide/serializers.md | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md index 2797b5f5..c48461d8 100755 --- a/docs/api-guide/serializers.md +++ b/docs/api-guide/serializers.md @@ -374,16 +374,20 @@ Returns the field instance that should be used to represent the pk field. ### get_nested_field -**Signature**: `.get_nested_field(self, model_field)` +**Signature**: `.get_nested_field(self, model_field, related_model, to_many)` Returns the field instance that should be used to represent a related field when `depth` is specified as being non-zero. +Note that the `model_field` argument will be `None` for reverse relationships. The `related_model` argument will be the model class for the target of the field. The `to_many` argument will be a boolean indicating if this is a to-one or to-many relationship. + ### get_related_field -**Signature**: `.get_related_field(self, model_field, to_many=False)` +**Signature**: `.get_related_field(self, model_field, related_model, to_many)` Returns the field instance that should be used to represent a related field when `depth` is not specified, or when nested representations are being used and the depth reaches zero. +Note that the `model_field` argument will be `None` for reverse relationships. The `related_model` argument will be the model class for the target of the field. The `to_many` argument will be a boolean indicating if this is a to-one or to-many relationship. + ### get_field **Signature**: `.get_field(self, model_field)` |
