class AddressSerializer(serializers.ModelSerializer):
id = serializers.IntegerField(write_only=True, required=False)
created_at = serializers.DateTimeField(required=False)
updated_at = serializers.DateTimeField(required=False)
class Meta:
model = Address
fields = '__all__'
When I write a new address to the DB with location data, the wrong location is written. For example, if I provide (60,-140) as the lat and lon parameters of my location field, what is written to my database is (60,-40). The longitude + 180 is being written to the DB, instead of just the longitude. Has anybody encountered the same issue?
In my models.py:
In my views.py:
In my serializers.py:
When I write a new address to the DB with location data, the wrong location is written. For example, if I provide (60,-140) as the lat and lon parameters of my location field, what is written to my database is (60,-40). The longitude + 180 is being written to the DB, instead of just the longitude. Has anybody encountered the same issue?