-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
💫 [IMPR] Add sensitive areas to mobile API and sync (#4490)
- Loading branch information
1 parent
891c845
commit 5bfa09a
Showing
17 changed files
with
299 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-07-12 12:45+0000\n" | ||
"POT-Creation-Date: 2025-02-13 10:14+0000\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -138,6 +138,9 @@ msgstr "" | |
msgid "Touristic event types" | ||
msgstr "" | ||
|
||
msgid "Sensitive area practices" | ||
msgstr "" | ||
|
||
msgid "Sync verifications" | ||
msgstr "" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-07-12 12:45+0000\n" | ||
"POT-Creation-Date: 2025-02-13 10:14+0000\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -138,6 +138,9 @@ msgstr "" | |
msgid "Touristic event types" | ||
msgstr "" | ||
|
||
msgid "Sensitive area practices" | ||
msgstr "" | ||
|
||
msgid "Sync verifications" | ||
msgstr "" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-07-12 12:45+0000\n" | ||
"POT-Creation-Date: 2025-02-13 10:14+0000\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -138,6 +138,9 @@ msgstr "" | |
msgid "Touristic event types" | ||
msgstr "" | ||
|
||
msgid "Sensitive area practices" | ||
msgstr "" | ||
|
||
msgid "Sync verifications" | ||
msgstr "" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-07-12 12:45+0000\n" | ||
"POT-Creation-Date: 2025-02-13 10:14+0000\n" | ||
"PO-Revision-Date: 2020-10-20 16:33+0000\n" | ||
"Last-Translator: Bastien Potiron <[email protected]>\n" | ||
"Language-Team: French <https://weblate.makina-corpus.net/projects/geotrek-" | ||
|
@@ -139,6 +139,9 @@ msgstr "Types de contenu touristique" | |
msgid "Touristic event types" | ||
msgstr "Types d'événements touristiques" | ||
|
||
msgid "Sensitive area practices" | ||
msgstr "Pratiques en zone sensible" | ||
|
||
msgid "Sync verifications" | ||
msgstr "Vérification de la synchronisation" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-07-12 12:45+0000\n" | ||
"POT-Creation-Date: 2025-02-13 10:14+0000\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -138,6 +138,9 @@ msgstr "" | |
msgid "Touristic event types" | ||
msgstr "" | ||
|
||
msgid "Sensitive area practices" | ||
msgstr "" | ||
|
||
msgid "Sync verifications" | ||
msgstr "" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-07-12 12:45+0000\n" | ||
"POT-Creation-Date: 2025-02-13 10:14+0000\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -138,6 +138,9 @@ msgstr "" | |
msgid "Touristic event types" | ||
msgstr "" | ||
|
||
msgid "Sensitive area practices" | ||
msgstr "" | ||
|
||
msgid "Sync verifications" | ||
msgstr "" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from django.conf import settings | ||
from rest_framework import serializers | ||
from rest_framework_gis import serializers as geo_serializers | ||
|
||
|
||
if 'geotrek.sensitivity' in settings.INSTALLED_APPS: | ||
from geotrek.sensitivity import models as sensitivity_models | ||
|
||
class SensitiveAreaListSerializer(geo_serializers.GeoFeatureModelSerializer): | ||
geometry = geo_serializers.GeometryField(read_only=True, precision=7, source='geom2d_transformed') | ||
name = serializers.ReadOnlyField(source='species.name') | ||
description = serializers.ReadOnlyField() | ||
practices = serializers.PrimaryKeyRelatedField(many=True, source='species.practices', read_only=True) | ||
info_url = serializers.URLField(source='species.url') | ||
period = serializers.SerializerMethodField() | ||
|
||
class Meta: | ||
model = sensitivity_models.SensitiveArea | ||
id_field = 'pk' | ||
geo_field = 'geometry' | ||
fields = ( | ||
'id', 'pk', 'name', 'description', 'practices', | ||
'contact', 'info_url', 'period', 'geometry', | ||
) | ||
|
||
def get_period(self, obj): | ||
return [getattr(obj.species, 'period{:02}'.format(p)) for p in range(1, 13)] |
Oops, something went wrong.