Hello,

I am new at this, so I am sure that this is easy. I understand how the
mapper works, and I can get it working fine when mapping tables to
classes. What I need to do is map the following select statement to a
class:

SELECT function_name(column_name) AS c1 FROM table_name

The usage of the function as part of the select statement is causing
me some problems. Initially I tried this:

table = Table('table_name', metadata, Column('column_name', Integer,
primary_key=True))
sel = select ([table.c.column_name, 'function_name(column_name) AS
c1'], from_obj=[table]).alias()
mapper(ClassName, sel)

That didn't work correctly, so I am somewhat at a loss as to how to
handle that function in the select statement. Does anyone have any
suggestions?

Thanks,

--
Damien

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to