Commit cfb66c58 authored by hypsug0's avatar hypsug0
Browse files

feat: improve search form

parent 5a947332
......@@ -38,7 +38,7 @@ class SimplePlaceSerializer(serializers.ModelSerializer):
class Meta:
model = Place
fields = ("name", "municipality_data")
fields = ("id_place", "name", "municipality_data")
class ContactSerializer(serializers.ModelSerializer):
......@@ -53,7 +53,7 @@ class SessionSerializer(serializers.ModelSerializer):
class Meta:
model = Session
fields = ("name", "contact_data", "date_start", "place_data")
fields = ("id_session", "name", "contact_data", "date_start", "place_data")
class AccountSerializer(serializers.ModelSerializer):
......@@ -65,6 +65,7 @@ class AccountSerializer(serializers.ModelSerializer):
class SightingSerializer(serializers.ModelSerializer):
class Meta:
model = Sighting
depth = 1
fields = (
"id_sighting",
"codesp",
......@@ -89,7 +90,7 @@ class GeoSightingSerializer(serializers.GeoFeatureModelSerializer):
# countdetail = SerializerMethodField()
class Meta(SightingSerializer.Meta):
depth = 1
depth = 0
geo_field = "geom"
fields = SightingSerializer.Meta.fields + (
"specie_data",
......@@ -117,6 +118,7 @@ class EditSightingSerializer(SightingSerializer):
class Meta:
model = Sighting
depth = 1
fields = (
"id_sighting",
"session",
......
......@@ -67,8 +67,8 @@
<div class="col-xs-12 col-sm-12 col-md-6">
<label>Observateur principal</label>
<div class="well well-sm">
<b>{{ object.main_observer.get_full_name }}</b>
({{ object.main_observer.username }})
<b>{{ object.main_observer.get_full_name|default:'Non renseigné ou utilisateur supprimé' }}</b>
({{ object.main_observer.username|default:'-' }})
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-6">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment