Skip to content

Commit

Permalink
patch: add missing fields (#1119)
Browse files Browse the repository at this point in the history
* patch: add missing fields

* patch: return missing fields

* patch: return missing fields
  • Loading branch information
tinashechiraya authored Oct 14, 2024
1 parent 7194c1c commit 7f83f09
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion django_project/monitor/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ def create(self, validated_data):
class SitesAndObservationsSerializer(serializers.ModelSerializer):
sitename = serializers.CharField(source='site_name')
rivername = serializers.CharField(source='river_name')
longitude = serializers.FloatField(source='the_geom.x')
latitude = serializers.FloatField(source='the_geom.y')
sitedescription = serializers.CharField(source='description')
rivercategory = serializers.CharField(source='river_cat')
observations = serializers.SerializerMethodField()
Expand All @@ -257,7 +259,9 @@ class Meta:
fields = [
'gid',
'sitename',
'rivername',
'rivername',
'longitude',
'latitude',
'sitedescription',
'rivercategory',
'images',
Expand All @@ -277,6 +281,8 @@ def to_representation(self, instance):
'rivername': data['rivername'],
'rivercategory': data['rivercategory'],
'sitedescription': data['sitedescription'],
'longitude': data['longitude'],
'latitude': data['latitude'],
'images': data['images'],
'observations': data['observations'],
},
Expand Down

0 comments on commit 7f83f09

Please sign in to comment.