Open irfanpule opened 3 years ago
@irfanpule may be you want to convert string you get back to dictionary
If that's the case, you can use json.loads(response.data)
to deserialize it
it will deserialize a feature, not a FeatureCollection
{
"id": 395,
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
106.92374152131379,
-6.938941860571504
]
},
"properties": {
"date": "2020-02-10",
"time": "17:15:04",
"video_sec": 7,
"speed": 3.406,
"road_number": 1
}
}
so you can pass the features
array from your request body to your PointSerializer
model like so:
PointSerializer(data=request.data["features"], many=True)`
example I have serializer
and I get serialize data or response
How I deserializer this response ?