Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update options api #3481

Merged
merged 1 commit into from
Sep 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions mobile/api_views/choices.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from bims.models import Biotope, TaxonGroup
from bims.models.sampling_method import SamplingMethod
from bims.enums.ecosystem_type import HYDROPERIOD_CHOICES


class AllChoicesApi(APIView):
Expand Down Expand Up @@ -33,7 +34,6 @@ def get(self, request, *args):
'name': sampling_method['sampling_method']
})


return Response({
'broad_biotope': Biotope.objects.broad_biotope_list(
taxon_group),
Expand All @@ -42,5 +42,9 @@ def get(self, request, *args):
'substratum_biotope': Biotope.objects.substratum_list(
taxon_group
),
'sampling_method': sampling_method_list
'sampling_method': sampling_method_list,
'hydroperiod': [{
'id': hydroperiod[0],
'name': hydroperiod[1]
} for hydroperiod in HYDROPERIOD_CHOICES]
})
Loading