Skip to content

Commit

Permalink
django-bims-3466 We need to be able to colour code sites
Browse files Browse the repository at this point in the history
  • Loading branch information
dimasciput committed Sep 18, 2023
1 parent 53c0ec4 commit 4a35446
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions bims/api_views/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion bims/api_views/search_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 4a35446

Please sign in to comment.