you should use the _label attribute on the column itself for the
name, or just use the column:
v = row[column._label]
v = row[column]
youre not going to want to turn off the max-length logic since your
database is giong to start throwing errors (esp. if youre on oracle -
30 chars max! , but postgres too)
On Apr 21, 2006, at 2:38 PM, Peter L. Buschman wrote:
Is there any way to turn off the max-length logic? I ran into it
where one particular table and column both
had particularly long names. I worked around it by using table
aliases but the readability of the code suffered
a bit.
At 18:49 21.4.06, Michael Bayer wrote:
yeah use_labels probably needed.
or, you can also say:
select([table1.c.mycol.label('somelabel') ,
table1.c.othercolumn.label('otherlabel')])
to label columns.
in a related topic, if youre using use_labels, you can also address
columns in the row based on the Column object directly:
val = row[table.c.column3]
which searches for the column in the row by checking its name, its
key, and its natural "label" (i.e. 'tablename_colname' usually,
although theres some max-length logic that kicks in for long names)
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users