Skip to content

Content Tagged "drf"

Page 1 of 1

Content Tagged "drf"

DRF: What is 'source' in Fields?

September 30, 2017Categories: Software, Tutorial
For a couple of days I've been trying to de-serialise a JSON to a model. My problem is the model and the JSON have different fields, mainly to keep the model pythonic and independent of a specific JSON source. So... I've been trying to use the source parameter for each Field in my serialiser to…

Timestamp to DateTime Serializer Field for DRF

September 29, 2017Categories: Software, Tutorial
I'm currently trying to deserialize JSON data to a Django model. This is quite straight forward for most numeric fields, but I have a DateTime field which is stored as a timestamp in the original JSON. At first, I thought I should read the timestamp as an integer and convert it through post…

All tags