Skip to content

Commit

Permalink
sql 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
joelclems committed Jan 11, 2024
1 parent 78adbb1 commit 9b70254
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion backend/gn_modulator/schema/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import csv
import datetime
from gn_modulator.query.utils import pretty_sql
from geonature.utils.env import db


class Line(object):
Expand Down Expand Up @@ -227,7 +228,7 @@ def process_export_csv(self, module_code, query_list, params):
params.get("fields"), params.get("process_field_name")
)

res_list = self.serialize_list(q.all(), fields=fields)
res_list = self.serialize_list(db.session.execute(q).unique().all(), fields=fields)

if not res_list:
return jsonify([]), 404
Expand Down
2 changes: 1 addition & 1 deletion backend/gn_modulator/schema/models/column_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def cp_select(self, key, column_property_def):
index += 1
cp = func.concat(*items)
if conditions:
cp = select([cp]).where(and_(*conditions))
cp = select(cp).where(and_(*conditions))
return cp

raise errors.SchemaModelColumnPropertyError(
Expand Down

0 comments on commit 9b70254

Please sign in to comment.