Re: [sqlalchemy] label & column_descriptions

2014-03-20 Thread lars van Gemerden
Hi Michael, OK, that's why. Below are the stack traces. They are not the same for A.b and A_b. If i use other labels this error does not happen. cheers, lars with expr.label( "%s_%s" % (cls.__name__, attr_name)): File "C:\python27\lib\site-packages\bottle.py", line 781, in _handle return

Re: [sqlalchemy] label & column_descriptions

2014-03-20 Thread Michael Bayer
On Mar 20, 2014, at 9:22 AM, lars van gemerden wrote: > I solved it (again): > > for future reference: > > say you have the expression Person.name (Person is SQLA class) to use in a > query, to have a label show up under that name in the resulting KeyedTuple's: > > to do: > > Person.name.la

Re: [sqlalchemy] label & column_descriptions

2014-03-20 Thread Michael Bayer
On Mar 19, 2014, at 2:49 PM, lars van gemerden wrote: > Hi all, > > I solved this before, but i took me half a day and a lot of guessing and i > forgot. > > If i add (sometimes calculated) columns to a query and i want to set the > names manually (via label()?), how do i do that? How will i

[sqlalchemy] label & column_descriptions

2014-03-19 Thread lars van gemerden
Hi all, I solved this before, but i took me half a day and a lot of guessing and i forgot. If i add (sometimes calculated) columns to a query and i want to set the names manually (via label()?), how do i do that? How will i make them show up in a resulting KeyedTuple/column_descriptions()? Ch

Re: [sqlalchemy] label()

2010-04-08 Thread Michael Bayer
Thomas Heller wrote: > I'm doing my first steps with sqlalchemy - a really great package? > > Here is my question: > > I know already how to label columns or functions that I'm querying for, > like this: > > session.query(count().label("foo"), MyClass.id.label("my_id")) > > How can I label the resu

[sqlalchemy] label()

2010-04-08 Thread Thomas Heller
I'm doing my first steps with sqlalchemy - a really great package? Here is my question: I know already how to label columns or functions that I'm querying for, like this: session.query(count().label("foo"), MyClass.id.label("my_id")) How can I label the result when I search for a class? This d