Update docs/api-guide/fields.md

Co-authored-by: Tom Christie <tom@tomchristie.com>
This commit is contained in:
Francisco Couzo 2022-03-23 11:09:58 -03:00 committed by GitHub
parent ee5cda0c71
commit dcbd74bfcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,7 +85,7 @@ When serializing fields with dotted notation, it may be necessary to provide a `
class CommentSerializer(serializers.Serializer):
email = serializers.EmailField(source="user.email")
Would require user object to be fetched from database when it is not prefetched. If that is not wanted, be sure to be using `prefetch_related` and `select_related` methods appropriately. For more information about the methods refer to [django documentation][django-docs-select-related].
This case would require user object to be fetched from database when it is not prefetched. If that is not wanted, be sure to be using `prefetch_related` and `select_related` methods appropriately. For more information about the methods refer to [django documentation][django-docs-select-related].
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.