Skip to content

Commit

Permalink
Fix sql query for custom groundwater layer
Browse files Browse the repository at this point in the history
  • Loading branch information
meomancer committed Jan 15, 2024
1 parent db1f413 commit b502ef3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions django_project/igrac/forms/groundwater_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,14 @@ def update_sql(self, tree):
elif well_type == GGMN:
mv = 'mv_well_ggmn'
sql = (
"select id, ggis_uid, original_id, name, feature_type,purpose, status,organisation, country, year_of_drilling, aquifer_name, aquifer_type,manager, detail, location, created_at, created_by, last_edited_at, last_edited_by "
f"from {mv} where organisation_id IN (" +
f"{','.join(organisations)}" +
") order by created_at DESC"
"select id, ggis_uid, original_id, name, feature_type,purpose, status, organisation, "
'number_of_measurements_level as "groundwater_level_data", '
'number_of_measurements_quality as "groundwater_quality_data", '
'number_of_measurements_yield as "abstraction_discharge", '
"country, year_of_drilling, aquifer_name, aquifer_type,manager, detail, location, created_at, created_by, last_edited_at, last_edited_by "
f"from {mv} where organisation_id IN (" +
f"{','.join(organisations)}" +
") order by created_at DESC"
)
tree.find('metadata/entry/virtualTable/sql').text = sql

Expand Down

0 comments on commit b502ef3

Please sign in to comment.