diff --git a/bims/api_views/search.py b/bims/api_views/search.py index 7e0dd56cd..4ef28c8f8 100644 --- a/bims/api_views/search.py +++ b/bims/api_views/search.py @@ -761,7 +761,8 @@ def process_search(self): site_id=F('id')).values( 'site_id', 'geometry_point', - 'name' + 'name', + 'ecosystem_type' ).query.sql_with_params() if not self.location_sites_raw_query and self.search_query: @@ -770,7 +771,8 @@ def process_search(self): ).annotate(site_id=F('id')).values( 'site_id', 'geometry_point', - 'name' + 'name', + 'ecosystem_type' ).query.sql_with_params() self.collection_records = bio diff --git a/bims/api_views/search_module.py b/bims/api_views/search_module.py index 9983bd57a..44e2fb980 100644 --- a/bims/api_views/search_module.py +++ b/bims/api_views/search_module.py @@ -152,7 +152,8 @@ def run_search(self): ).values( 'site_id', 'geometry_point', - 'name' + 'name', + 'ecosystem_type' ).query.sql_with_params() def serialize_sites(self): diff --git a/bims/management/commands/add_default_fbis_location_site_view.py b/bims/management/commands/add_default_fbis_location_site_view.py index 05a43d21d..bdc2fdeff 100644 --- a/bims/management/commands/add_default_fbis_location_site_view.py +++ b/bims/management/commands/add_default_fbis_location_site_view.py @@ -18,7 +18,7 @@ def handle(self, *args, **options): view_name = 'default_fbis_location_site_cluster' query = ( 'SELECT bims_locationsite.id AS site_id,' - 'bims_locationsite.geometry_point, bims_locationsite.name ' + 'bims_locationsite.geometry_point, bims_locationsite.name, bims_locationsite.ecosystem_type ' 'FROM bims_locationsite;' ) cursor = connection.cursor()