1

This post answers how to dynamically return a subset of fields based on the field section in the URL. This is done by creating a dynamic serializer. This works great against a ModelViewSet, but will this affect the query to the database in any way, or will it still query all the fields, and then only the selected fields are returned to the client? If it is the later, is it possible to make it so that the query to the database is only for the specific fields if any is provided, or will I have to create a view for each query I wish to make?

0 Answers0