Fix issue with layer def

This commit is contained in:
phil 2024-04-21 10:14:09 +05:30
parent d08e40d579
commit 53c2e359da
3 changed files with 5 additions and 5 deletions

View file

@ -1 +1 @@
__version__: str = '2023.4.dev63+g52e1d21.d20240408'
__version__: str = '2023.4.dev68+gd08e40d.d20240420'

View file

@ -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]