Re: [sqlalchemy] Facing problem with aliasing while using union_all

2011-04-29 Thread monster jacker
On Wed, Apr 27, 2011 at 8:42 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Apr 27, 2011, at 10:58 AM, monster jacker wrote: The Query should return to you tuples that have names like row_num and test_msg, which are linked to the anon names that it generates: for row in myquery

Re: [sqlalchemy] Facing problem with aliasing while using union_all

2011-04-27 Thread monster jacker
if i try for row in record: print row.row_num, row.test_msg i am getting the attribute error : *** AttributeError: 'NamedTuple' object has no attribute 'row_num' On Mon, Apr 18, 2011 at 4:40 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Apr 18, 2011, at 1:50 AM, monster

Re: [sqlalchemy] Facing problem with aliasing while using union_all

2011-04-17 Thread monster jacker
On Sat, Apr 16, 2011 at 8:00 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Apr 16, 2011, at 3:57 AM, monster jacker wrote: query.union_all(query1, query2) is producing below select statement.As i added label method to change labels of columns to refer in the code. anonimous column

[sqlalchemy] Facing problem with aliasing while using union_all

2011-04-16 Thread monster jacker
Hi all, I am facing the problem with aliasing when i try to do union of SA queries. Following three SA queries -- query = self.session.query(Table1.row_num.label('row_num'), Table.test_msg.label('test_msg'),