[sqlalchemy] Re: renaming columns

2009-08-17 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Michele Simionato Sent: 17 August 2009 16:11 To: sqlalchemy Subject: [sqlalchemy] renaming columns There should be an easy way to do this, but I cannot find it in the

[sqlalchemy] Re: renaming columns

2009-08-17 Thread Michele Simionato
On Aug 17, 5:31 pm, King Simon-NFHD78 simon.k...@motorola.com wrote: I think you want something like column.label('newcol'). For example:   import sqlalchemy as sa   print sa.select([atable.c.acolumn.label('newcol')]) Yep, exactly! --~--~-~--~~~---~--~~ You

[sqlalchemy] Re: Renaming Columns and Union - possible bug

2009-01-03 Thread Eoghan Murray
On Jan 3, 2:44 am, Michael Bayer mike...@zzzcomputing.com wrote: I've made fixes to corresponding_column() to resolve this issue, and in the process uncovered (and also solved) a whole class of problems in that method which was, to my great surprise, also impacting some very nested Query

[sqlalchemy] Re: Renaming Columns and Union - possible bug

2009-01-03 Thread Michael Bayer
On Jan 3, 2009, at 7:31 PM, Eoghan Murray wrote: On Jan 3, 2:44 am, Michael Bayer mike...@zzzcomputing.com wrote: I've made fixes to corresponding_column() to resolve this issue, and in the process uncovered (and also solved) a whole class of problems in that method which was, to my great

[sqlalchemy] Re: Renaming Columns and Union - possible bug

2009-01-02 Thread Eoghan Murray
On Dec 22 2008, 7:10 pm, Eoghan Murray eoghanomur...@gmail.com wrote: On Dec 22, 4:16 pm, Gaetan de Menten gdemen...@gmail.com wrote: I'm not sure what you are trying to do, but MyE.f_1 and MyE.f_2 are not column objects. f_1_id and f_2_id are. Sorry, I edited down my example from a

[sqlalchemy] Re: Renaming Columns and Union - possible bug

2009-01-02 Thread Eoghan Murray
On Jan 2, 10:41 pm, Michael Bayer mike...@zzzcomputing.com wrote: It would help if you could illustrate with accurate code - the UNION   above does not have consistent numbers of columns in each select() and   I think what you're trying to do is reverse f_1 and f_2 in the second   select()

[sqlalchemy] Re: Renaming Columns and Union - possible bug

2008-12-22 Thread Gaetan de Menten
On Mon, Dec 22, 2008 at 17:06, Eoghan Murray eoghanomur...@gmail.com wrote: 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)