[sqlalchemy] Re: do I need subqueries for this?

2009-09-16 Thread Crusty
Hello Connor, yes that does help indeed, thanks a lot. My problem is though that i cannot use relation operators because I use a count over a certain row and group by clauses. So I kinda had to send my query manually but still I cant really get this stuff done cuz I am not really an SQL wizard.

[sqlalchemy] Re: How to instantiate objects of a class mapped against multiple tables?

2009-09-16 Thread bojanb
with_polymorphic can be set against any subset of classes, not just '*'. Yes, but in the first case I can't use with_polymorphic() on the query, because the query class is not the problem - I want the polymorphic load on an attribute (relation) of the queried class in order for the eagerload to

[sqlalchemy] Keepalives / reconnect

2009-09-16 Thread Teemu Yli-Elsilä
Hello, I'm deploying a Pylons/TG app that uses SQLAlchemy into a customer's server network. Due to their network architecture, TCP sessions from SA to the Oracle server are getting timed out by their Ciscos. My application needs to work around this. I heard that Mike Bayer had stated that

[sqlalchemy] Re: How to instantiate objects of a class mapped against multiple tables?

2009-09-16 Thread bojanb
I don't have the time most of today to get into it so I can't confirm what's going on.  Any chance you could map to a straight join of all four tables instead of a join to two sub-joins ? I tried the following join in the mapper for Subordinate: join(Employee, Person).join(Relation,

[sqlalchemy] append_column write to database?

2009-09-16 Thread tommy1987
Hi, I am calling the append_colum method on a Table several times to create several columns. The changes are not made apparent inside the database, do I have to perform some other task to make this happen? I read something about UpdateModel but I have tried this and it still fails to work as I

[sqlalchemy] Re: How to instantiate objects of a class mapped against multiple tables?

2009-09-16 Thread Michael Bayer
bojanb wrote: with_polymorphic can be set against any subset of classes, not just '*'. Yes, but in the first case I can't use with_polymorphic() on the query, because the query class is not the problem - I want the polymorphic load on an attribute (relation) of the queried class in order

[sqlalchemy] Re: Keepalives / reconnect

2009-09-16 Thread Michael Bayer
Teemu Yli-Elsilä wrote: Hello, I'm deploying a Pylons/TG app that uses SQLAlchemy into a customer's server network. Due to their network architecture, TCP sessions from SA to the Oracle server are getting timed out by their Ciscos. My application needs to work around this. I heard that

[sqlalchemy] Re: How to instantiate objects of a class mapped against multiple tables?

2009-09-16 Thread Michael Bayer
bojanb wrote: I hope this makes sense. Here's the code. When run, it throws ProgrammingError: (ProgrammingError) relation supervisor_relations_id_seq does not exist the solution is the same as that I illustrated in a previous email, that when you map to a JOIN you must place all equivalent

[sqlalchemy] Re: Declarative base - Joined Table Inheritence

2009-09-16 Thread Conor
On Sep 15, 11:03 pm, Jarrod Chesney jarrod.ches...@gmail.com wrote: Hi All I've been reading the documentation for ages and i can't figure out why when i print the results a query from my inherited table, It just prints them as the base type. I was hoping someone here would be nice enough

[sqlalchemy] Re: query().all() OK, query().delete() can't locate bind

2009-09-16 Thread Orca
you have to use Session.execute with explicit mapper defined, for some reason session.query.delete/update is not detecting any bindables in statement as it does for select-queries. if your TreeNode Table defined as Tree_Node_Table:

[sqlalchemy] Re: do I need subqueries for this?

2009-09-16 Thread Conor
On Sep 16, 3:38 am, Crusty crust...@gmail.com wrote: Hello Connor, yes that does help indeed, thanks a lot. My problem is though that i cannot use relation operators because I use a count over a certain row and group by clauses. So I kinda had to send my query manually but still I cant

[sqlalchemy] Re: query().all() OK, query().delete() can't locate bind

2009-09-16 Thread Jeff Enderwick
So is this likely a sqlalchemy bug? Should I just dig in a look into why the delete is not finding the bind where the select is? FWIW, here's a ref to delete+where: http://dev.mysql.com/doc/refman/5.0/en/delete.html 2009/9/16 Orca trueo...@gmail.com you have to use Session.execute with

[sqlalchemy] Re: Declarative base - Joined Table Inheritence

2009-09-16 Thread Jarrod Chesney
That worked, Thanks, ITS AWESOME :-) On Sep 17, 6:03 am, Conor conor.edward.da...@gmail.com wrote: On Sep 15, 11:03 pm, Jarrod Chesney jarrod.ches...@gmail.com wrote: Hi All I've been reading the documentation for ages and i can't figure out why when i print the results a query from my

[sqlalchemy] Re: Self Join

2009-09-16 Thread Paulo Aquino
On Tue, Sep 15, 2009 at 5:53 AM, Michael Bayer mike...@zzzcomputing.comwrote: Paulo Aquino wrote: I have 2 tables 'Product' and 'ProductPrice'. I want to get all valid products, a product is valid if it has both a valid 'Selling' and 'Buying' ProductPrice type. A ProductPrice is valid if

[sqlalchemy] Re: Self Join

2009-09-16 Thread Paulo Aquino
On Tue, Sep 15, 2009 at 5:53 AM, Michael Bayer mike...@zzzcomputing.comwrote: Paulo Aquino wrote: I have 2 tables 'Product' and 'ProductPrice'. I want to get all valid products, a product is valid if it has both a valid 'Selling' and 'Buying' ProductPrice type. A ProductPrice is valid if