Hi , I need a best practice.
I will add new data to my SampleModel with sending a request to external API. But on external api response, field names different from my model fields. So I want to serialize this data to my SampleModel object.
class SampleModel(models.Model):
sample_name = models.Charfield()
sample_age = models.IntegerField()
external_api_response = {
"sampleName":"foo",
"sampleAge":"bar"
}
I want this external_api_response to serialize to my model. But when i create a ModelSerializer fields not match. What is the best practice for this case.