Tomas Zulberti wrote:
> Hi. I am sort of a newbie on SQLAlchemy. Is there a way to do a query
> with the ORM, and doing an "as" on the select.
>
> For example:
>
> class Example(Base):
> name = Column(Unicode(512) ....)
>
>
> query = session.query(Example.name AS "foo")
> query.all()
>
>
Every column object has a label method, e.g. Example.name.label("foo").
However, the label is lost when you do query.all(), so I'm not sure what
you're trying to do here.
-Conor
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---