From fa3a2880bf439941d6ec66a58127f34e23706d3c Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Fri, 14 May 2021 17:03:46 +0200 Subject: [PATCH] Column property for EWKT --- matcher/model.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/matcher/model.py b/matcher/model.py index 7db239b..653eeca 100644 --- a/matcher/model.py +++ b/matcher/model.py @@ -197,6 +197,10 @@ class MapMixin: def geojson_str(cls): return column_property(func.ST_AsGeoJSON(cls.way), deferred=True) + @declared_attr + def as_EWKT(cls): + return column_property(func.ST_AsEWKT(cls.way), deferred=True) + def geojson(self): return json.loads(self.geojson_str)