On Nov 16, 5:15 pm, Conor <conor.edward.da...@gmail.com> wrote:
> 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

Thanks. That solved my problem.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@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