Hi
I use 0.8's column_expression. Like this:
-----
from sqlalchemy.types import UserDefinedType
from sqlalchemy.sql import func
class Geometry(UserDefinedType):
def column_expression(self, col):
return func.ST_AsBinary(col, type_=self)
from sqlalchemy import Table, Column, MetaData
lakes = Table('lake', MetaData(),
Column('geom', Geometry)
)
from sqlalchemy.sql import select
s = select([lakes])
print s
----
The final print statement returns this: "SELECT ST_AsBinary(lake.geom)
AS geom_1 FROM lake".
My issue is with the "geom_1" label being generated. My column name
being "geom" I'd expect the following to work:
s = select([lakes])
for row in conn.execute(s):
geom = row['geom']
but it won't work because "row" does not have a "geom" item.
Is there a solution to this issue?
Thanks,
--
Eric Lemoine
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex
Tel : 00 33 4 79 44 44 96
Mail :
eric.l...@camptocamp.com
http://www.camptocamp.com