[sqlalchemy] Modelling connected trees

2007-12-30 Thread Andreas Jung
Hi, I habe a table where we store tree-ish data using a self-referential mapper (same setup as within the SA docs using an id for the nodes and a pointer back to the parent node given by its id)...this works without a problem. Now comes the tricky part: a node from one tree can point to a node

[sqlalchemy] Session.execute (PostgreSQL) function not doing anything?

2007-12-30 Thread jerryji
Dear SQLAlchemy/database Gurus, I have a database (PostgreSQL 8.2) function that works -- mydb=# \df function_insert_label_relations List of functions Schema | Name | Result data type |Argument data types

[sqlalchemy] eagerload and joined table inheritance

2007-12-30 Thread Matt
Hi all, I'm having an issue where I'm doing a query that I want to be loaded all in one select to the database. I have a table ContentLeaf which inherits from Content, I can get the ContentLeaf fields to eagerload by using select_table in the mapper: myjoin =

[sqlalchemy] Re: Session.execute (PostgreSQL) function not doing anything?

2007-12-30 Thread Alexandre da Silva
What is missing there? Any tips/pointers would be greatly appreciated! I not tested here if is solve your problem, but, are you calling the commit() after execution? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[sqlalchemy] Re: Session.execute (PostgreSQL) function not doing anything?

2007-12-30 Thread jerryji
The missing commit() is the culprit! Thanks so much Alex. It has been a little deceiving as commit() doesn't seem to be required for calling execute() on select statements Sincerely, Jerry On Dec 30, 3:24 pm, Alexandre da Silva [EMAIL PROTECTED] wrote: What is missing there? Any

[sqlalchemy] Re: eagerload and joined table inheritance

2007-12-30 Thread Michael Bayer
On Dec 30, 2007, at 3:20 PM, Matt wrote: Hi all, I'm having an issue where I'm doing a query that I want to be loaded all in one select to the database. I have a table ContentLeaf which inherits from Content, I can get the ContentLeaf fields to eagerload by using select_table in the

[sqlalchemy] Re: Modelling connected trees

2007-12-30 Thread Michael Bayer
On Dec 30, 2007, at 11:05 AM, Andreas Jung wrote: Hi, I habe a table where we store tree-ish data using a self-referential mapper (same setup as within the SA docs using an id for the nodes and a pointer back to the parent node given by its id)...this works without a problem. Now comes

[sqlalchemy] Re: Session.execute (PostgreSQL) function not doing anything?

2007-12-30 Thread Michael Bayer
On Dec 30, 2007, at 5:49 PM, jerryji wrote: The missing commit() is the culprit! Thanks so much Alex. It has been a little deceiving as commit() doesn't seem to be required for calling execute() on select statements Sincerely, Jerry one thing thats tricky here is that if you weren't

[sqlalchemy] Re: eagerload and joined table inheritance

2007-12-30 Thread Matt
Yeah, I didn't include the whole Content mapper, here are the polymorphic params for that mapper: polymorphic_on=content_table.c.type, polymorphic_identity='content' And ContentLeaf: mapper(ContentLeaf, content_leaf, properties = { '_copyright':

[sqlalchemy] Re: eagerload and joined table inheritance

2007-12-30 Thread Michael Bayer
On Dec 30, 2007, at 8:01 PM, Matt wrote: Yeah, I didn't include the whole Content mapper, here are the polymorphic params for that mapper: polymorphic_on=content_table.c.type, polymorphic_identity='content' And ContentLeaf: mapper(ContentLeaf, content_leaf, properties = {