Re: [sqlalchemy] group by and Oracle

2010-12-05 Thread jo
Yes, Ian, it works, :-) thank you j Ian Kelly wrote: On Fri, Dec 3, 2010 at 4:08 AM, jo jose.soa...@sferacarta.com wrote: Hi all, I'm trying to write a GROUP BY query grouped by a function (to_char) using a variable format, which could be 'yy' or '' as in: sql=session.query(

Re: [sqlalchemy] finding if a table is already join in a query

2010-12-05 Thread Thadeus Burgess
What if your query already has a join yet you need to add another WHERE clause to the join? This fails with This query already has a join for Table xxx. Any way to modify your join to a query after you join it? -- Thadeus On Wed, Dec 1, 2010 at 8:08 AM, Michael Bayer

Re: [sqlalchemy] finding if a table is already join in a query

2010-12-05 Thread Michael Bayer
To the ON clause ? you'd need to find the join() and surgically replace its on clause, which again likely has issues in more complex cases, such as if any kind of aliasing is going on, joined table inheritance in use, etc. I'll reiterate that this is not the way I'd be approaching this

[sqlalchemy] Re: Adding expressions to a Query

2010-12-05 Thread Jurie-Jan Botha
one option would be to add the expression to your model as a column_property This is unfortunately not an option as this extra column compiles it's value from the values of more than one model. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To

[sqlalchemy] Re: Adding expressions to a Query

2010-12-05 Thread Jurie-Jan Botha
I found that it's really as easy as using query.add_columns(). My problem was caused by my not reading the documentation properly and trying to use a list in the add_columns() method instead of just positional arguments. one option would be to add the expression to your model as a

[sqlalchemy] Excluding a column form Query result

2010-12-05 Thread Jurie-Jan Botha
Is there a way to add a column to a Query object to be used elsewhere in the query, but prevent it from being listed in the result of the Query? -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to