DRF how to choose serializer for a field based on value of another field
So the problem is I would like to choose the serializer to be used to serialize a particular field based on the value of another field, so for example (pseudocode):
DRF how to choose serializer for a field based on value of another field
So the problem is I would like to choose the serializer to be used to serialize a particular field based on the value of another field, so for example (pseudocode):
Cannot upload photos or videos on postviewset
I am writing the create
function in postViewset
, specifically I want to create an article, I can upload both photos or videos, but when testing the postman, the result is still created, however, then it Media
is empty, I try print (media_image_request)
and print(media_video_request)
the result is []
. Please help me fix this error in the function create
and the partial_update
.