diff --git a/pyproject.toml b/pyproject.toml index dc1cdf3..e8f698e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,7 @@ dependencies = [ "plotly>=5.20.0", "matplotlib>=3.8.3", "aiopath>=0.6.11", + "psycopg2-binary>=2.9.9", ] requires-python = ">=3.11,<4" readme = "README.md" diff --git a/src/gisaf/_version.py b/src/gisaf/_version.py index 699f4f2..55c3ec9 100644 --- a/src/gisaf/_version.py +++ b/src/gisaf/_version.py @@ -1 +1 @@ -__version__: str = '2023.4.dev63+g52e1d21.d20240408' \ No newline at end of file +__version__: str = '2023.4.dev68+gd08e40d.d20240420' \ No newline at end of file diff --git a/src/gisaf/models/geo_models_base.py b/src/gisaf/models/geo_models_base.py index 75a9982..40444e1 100644 --- a/src/gisaf/models/geo_models_base.py +++ b/src/gisaf/models/geo_models_base.py @@ -19,7 +19,6 @@ from sqlmodel.ext.asyncio.session import AsyncSession from sqlalchemy import BigInteger, String, func, and_, text from sqlalchemy.sql import sqltypes from sqlalchemy.orm import declared_attr -from psycopg import adapt from geoalchemy2.shape import from_shape from geoalchemy2.types import Geometry, WKBElement from shapely import wkb, from_wkb @@ -237,7 +236,7 @@ class SurveyModel(BaseSurveyModel): FROM ( SELECT f.geom, f.id::varchar, - {description} || ' [' || '{category.group}' || '-' || '{category.minor_group_1}' || '] #' || f.id as popup, + '{description}' || ' [' || '{category.group}' || '-' || '{category.minor_group_1}' || '] #' || f.id as popup, f.status FROM "{schema}"."{table}" as f WHERE f.geom is not null @@ -258,7 +257,7 @@ class SurveyModel(BaseSurveyModel): 'geometry', ST_AsGeoJSON(geom)::jsonb, 'properties', jsonb_build_object( 'popup', - {description} || ' [' || '{category.group}' || '-' || '{category.minor_group_1}' || '] #' || inputs.id::varchar, + '{description}' || ' [' || '{category.group}' || '-' || '{category.minor_group_1}' || '] #' || inputs.id::varchar, 'status', status ) ) AS feature @@ -277,7 +276,7 @@ class SurveyModel(BaseSurveyModel): #table=cls.__tablename__, # FIXME: should be __tablename__, but see SQLModel.__tablename__ which use lower(__name__) table=cls.__name__, - description=adapt(category.description), + description=category.description, ) result = await session.exec(text(query)) return result.first()[0]