How to add fields to serializer
I would like to add foreign key fields to DRF serializer. I need API endpoint with information of Publication details with all Comments to this publication with all Images to this publication and with Likes number to this publication.
Can someone explain to me what “data = validated_data.copy()” means?
I wonder why the create
method does not process the data directly but has to copy it into data
and then process it indirectly, while the returned result is also the processed user.