You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class A(models.Model):
aaa = models.PolygonField(null=True, blank=True, srid=4326)
Serializer:
class Aserial(GeoModelSerializer):
class Meta:
model = A
fields = ('aaa',)
And serializer.data returns:
File "/Users/paulocheque/Programming/leaf-toptal/Leaf-Management-Software/env1.8/lib/python3.4/site-packages/rest_framework/serializers.py", line 622, in data
ret = super(ListSerializer, self).data
File "/Users/paulocheque/Programming/leaf-toptal/Leaf-Management-Software/env1.8/lib/python3.4/site-packages/rest_framework/serializers.py", line 217, in data
self._data = self.to_representation(self.instance)
File "/Users/paulocheque/Programming/leaf-toptal/Leaf-Management-Software/env1.8/lib/python3.4/site-packages/rest_framework/serializers.py", line 572, in to_representation
self.child.to_representation(item) for item in iterable
File "/Users/paulocheque/Programming/leaf-toptal/Leaf-Management-Software/env1.8/lib/python3.4/site-packages/rest_framework/serializers.py", line 572, in <listcomp>
self.child.to_representation(item) for item in iterable
File "/Users/paulocheque/Programming/leaf-toptal/Leaf-Management-Software/env1.8/lib/python3.4/site-packages/rest_framework/serializers.py", line 439, in to_representation
ret[field.field_name] = field.to_representation(attribute)
File "/Users/paulocheque/Programming/leaf-toptal/Leaf-Management-Software/env1.8/lib/python3.4/site-packages/rest_framework/serializers.py", line 439, in to_representation
ret[field.field_name] = field.to_representation(attribute)
File "/Users/paulocheque/Programming/leaf-toptal/Leaf-Management-Software/env1.8/lib/python3.4/site-packages/rest_framework/fields.py", line 863, in to_representation
value = decimal.Decimal(six.text_type(value).strip())
decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]
I printed the value and its type and the GeometryField(allow_null=True, required=False) is receiving a django.contrib.gis.db.models.query.GeoQuerySet
The text was updated successfully, but these errors were encountered:
Libs:
settings:
Model:
Serializer:
And serializer.data returns:
I printed the value and its type and the
GeometryField(allow_null=True, required=False)
is receiving adjango.contrib.gis.db.models.query.GeoQuerySet
The text was updated successfully, but these errors were encountered: