Skip to content

Commit

Permalink
revert bug
Browse files Browse the repository at this point in the history
  • Loading branch information
submarcos committed Jul 10, 2024
1 parent 61e6730 commit 6167018
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions backend/project/api/serializers/observations.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,36 +101,8 @@ class Meta(ObservationMixin.Meta):
fields = ObservationMixin.Meta.fields + ("medias",)


class AreaBBoxSerializer(serializers.ModelSerializer):
north_west = serializers.ListSerializer(
source="north_west.coords",
child=serializers.FloatField(),
max_length=2,
min_length=2,
)
south_east = serializers.ListSerializer(
source="south_east.coords",
child=serializers.FloatField(),
max_length=2,
min_length=2,
)

class Meta:
model = Area
fields = ("north_west", "south_east")


class AreaSerializer(serializers.ModelSerializer):
bbox2 = AreaBBoxSerializer(source="*")
bbox = serializers.ListSerializer(
child=serializers.ListSerializer(
child=serializers.FloatField(),
max_length=2,
min_length=2,
),
max_length=2,
min_length=2,
)
bbox = serializers.SerializerMethodField()

def get_bbox(self, obj):
return [obj.north_west.coords, obj.south_east.coords]
Expand Down

0 comments on commit 6167018

Please sign in to comment.