Hi
Here's my case: I have
- my own TypeEngine class, MyTypeEngine
- a Table with a Column using MyTypeEngine:
table = Table("tablename", metadata,
Column("columname", MyTypeEngine()),
autoload=True, autoload_with=engine
)
- a class:
class MyClass(object):
pass
- and a mapping:
mapper(MyClass, table)
Pretty standard. Now, instead of queries like this:
SELECT columnname, ... FROM tablename
I'd like queries like this:
SELECT somefunc(columnname),... FROM tablename
I thought I could get that by overriding my column's ColumnProperty
with something like that:
mapper(MyClass, table, properties={
"columname": column_property(
sql.func.somefunc(table.c.columname).label("columnname")
)
})
but it doesn't work as I'd like because it seems that my TypeEngine is
no longer involved after querying my table - the function returned by
my TypeEngine's "result_process" method doesn't seem to be called.
Is this expected? Do I have solutions to that problem?
Thanks a lot,
--
Eric Lemoine
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex
Tel : 00 33 4 79 44 44 96
Mail : [email protected]
http://www.camptocamp.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---