[sqlalchemy] Re: self referencing column

2010-08-27 Thread waugust
Hmmm... can't seem to pickle WSGI functions in Pylons...we'll have to take it to the Pylons bored :) On Aug 26, 10:37 pm, Wojtek Augustynski waugustyn...@gmail.com wrote: Thanks, though! :) Don't suppose you would have an idea on how I could store a procedure? :) the actions to which I'm

Re: [sqlalchemy] Sudden Connection issues

2010-08-27 Thread Warwick Prince
Hi Michael OK, I've invested (wasted?) my entire day on this connection issue and have the following to report. Hopefully, the hints I've managed to find may trigger something with you that will point me in the right direction. In recap; the issue was I could not get a simple engine to

Re: [sqlalchemy] Sudden Connection issues

2010-08-27 Thread Michael Bayer
On Aug 27, 2010, at 4:39 AM, Warwick Prince wrote: Hi Michael OK, I've invested (wasted?) my entire day on this connection issue and have the following to report. Hopefully, the hints I've managed to find may trigger something with you that will point me in the right direction. In

[sqlalchemy] Checking internals of query object

2010-08-27 Thread Bryan
I am writing a function that adds particular columns and groupings to a query based on some options. I am trying to write some unit tests for the function, and would like to check that the correct columns are being added/grouped. Give a query like: q = session.query(Employee.firstName,

[sqlalchemy] Re: Checking internals of query object

2010-08-27 Thread Bryan
I'm considering just checking for terms in the sql statement produced from str(query). That way I don't have to muddle with the internals of Query. However, I do introduce table and column names from the DB into my test code as strings, which of course defeats one of the reasons for using SA.

[sqlalchemy] string_agg() with order by clause

2010-08-27 Thread David Gardner
Recently Postgres added a new aggregate function called string_agg(). I have been able to use it like: Session.query(Asset, func.string_agg(some_col, ',')) This works, but according to the docs I should be able to do string_agg(some_col, ',' ORDER BY some_col) Is there a way to do this in

Re: [sqlalchemy] string_agg() with order by clause

2010-08-27 Thread David Gardner
I should have linked to the docs in question http://developer.postgresql.org/pgdocs/postgres/sql-expressions.html#SYNTAX-AGGREGATES On 08/27/2010 03:03 PM, David Gardner wrote: Recently Postgres added a new aggregate function called string_agg(). I have been able to use it like:

Re: [sqlalchemy] string_agg() with order by clause

2010-08-27 Thread Conor
On 08/27/2010 05:06 PM, David Gardner wrote: I should have linked to the docs in question http://developer.postgresql.org/pgdocs/postgres/sql-expressions.html#SYNTAX-AGGREGATES On 08/27/2010 03:03 PM, David Gardner wrote: Recently Postgres added a new aggregate function called string_agg().

Re: [sqlalchemy] string_agg() with order by clause

2010-08-27 Thread David Gardner
Fantastic! That works. Out of curiosity I noticed that the compile function expects to receive instances of Column. This isn't a big problem because I just reverted to doing table_var.c.my_col, but is there a simpler way to use MyClassName.Col? On 08/27/2010 04:02 PM, Conor wrote: On

Re: [sqlalchemy] string_agg() with order by clause

2010-08-27 Thread Michael Bayer
On Aug 27, 2010, at 8:56 PM, David Gardner wrote: Fantastic! That works. Out of curiosity I noticed that the compile function expects to receive instances of Column. This isn't a big problem because I just reverted to doing table_var.c.my_col, but is there a simpler way to use

Re: [sqlalchemy] Sudden Connection issues

2010-08-27 Thread Warwick Prince
Hi Michael Sorry about that - it had been a long day and I didn't realise I was quoting code from the connector! I'll get onto them and see if they can help. Cheers Warwick Warwick Prince Managing Director mobile: +61 411 026 992 skype: warwickprince phone: +61 7 3102 3730 fax: