We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
example I have serializer
class PointSerializer(GeoFeatureModelSerializer): class Meta: model = PointModel fields = '__all__' geo_field = 'geom'
and I get serialize data or response
{ "type": "FeatureCollection", "features": [ { "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 } }, { "id": 432, "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 106.92334589548409, -6.940676830708981 ] }, "properties": { "date": "2020-02-10", "time": "17:15:41", "video_sec": 44, "speed": 6.093, "photo_file": "", "road_number": 1 } } ] }
How I deserializer this response ?
The text was updated successfully, but these errors were encountered:
@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
json.loads(response.data)
Sorry, something went wrong.
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:
features
PointSerializer
PointSerializer(data=request.data["features"], many=True)`
No branches or pull requests
example I have serializer
and I get serialize data or response
How I deserializer this response ?
The text was updated successfully, but these errors were encountered: