[sqlalchemy] renaming columns

2009-08-17 Thread Michele Simionato
There should be an easy way to do this, but I cannot find it in the documentation. I would like to generate a query with a renamed column, something like this: SELECT acolumn AS newcol FROM atable I tried things like print atable.select().with_only_columns([atable.c.acolumn.as_ ('newcol')]) Wh

[sqlalchemy] Renaming Columns and Union - possible bug

2008-12-22 Thread Eoghan Murray
The following example uses an elixir class: class MyE(Entity): id = Field(Integer, primary_key=True) f_1 = ManyToOne('OtherE') f_2 = ManyToOne('OtherE') date = Field(Date) MyE.query.select_from(union(MyE.table.select(), select([MyE.id, MyE.f_1.label('f_