Skip to content

Commit

Permalink
fix text sql query from api
Browse files Browse the repository at this point in the history
  • Loading branch information
sdrll committed Aug 29, 2023
1 parent 39aa1a3 commit 7ab70be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/zones_api/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy import Column, Integer, String, ForeignKey, text
from sqlalchemy.orm import relationship, backref
from sqlalchemy.orm import object_session
import json
Expand All @@ -25,7 +25,7 @@ class Zone(Base):

@property
def bounding_box(self):
query = 'select st_asgeojson(ST_Transform(st_envelope(geometry), 4326)) from zones where id = :id'
query = text('select st_asgeojson(ST_Transform(st_envelope(geometry), 4326)) from zones where id = :id')
row = object_session(self).execute(query, {'id': self.id}).first()
if row is None:
return None
Expand Down

0 comments on commit 7ab70be

Please sign in to comment.