Re: [sqlalchemy] Changing columns in query

2016-04-30 Thread Mike Bayer
yes please use query.with_entities http://docs.sqlalchemy.org/en/rel_1_0/orm/query.html?highlight=query.with_entities#sqlalchemy.orm.query.Query.with_entities On 04/30/2016 02:33 AM, Антонио Антуан wrote: I have the query: | q =Session.query(func.array_agg(Order.col)) | The compiled query

[sqlalchemy] Changing columns in query

2016-04-30 Thread Антонио Антуан
I have the query: q = Session.query(func.array_agg(Order.col)) The compiled query will be: SELECT array_agg(order.col) FROM orders I want dynamically replace the existing column. After replacing query have to be: SELECT group_concat(orders.col) FROM orders I have to use Session and model. I