[sqlalchemy] Re: Single table inheritance and mapping against a selectable

2007-07-28 Thread Gaetan de Menten
On 7/28/07, Michael Bayer [EMAIL PROTECTED] wrote: those are fine with me. if someone could add a ticket and/or implement that would be helpful. http://www.sqlalchemy.org/trac/ticket/696 -- Gaƫtan de Menten http://openhex.org --~--~-~--~~~---~--~~ You

[sqlalchemy] Re: permanent objects and sessions

2007-07-28 Thread Michael Bayer
your best option is probably to keep the objects in a session that's specifically for the global objects. Most important is that if you are using multiple threads, you never call flush() on this session. With regards to threadsafety in this case, as long as the session is not used for a flush()

[sqlalchemy] Re: permanent objects and sessions

2007-07-28 Thread michael
On Sat, 28 Jul 2007 14:36:45 - Michael Bayer [EMAIL PROTECTED] wrote: your best option is probably to keep the objects in a session that's specifically for the global objects. Most important is that if you are using multiple threads, you never call flush() on this session. With

[sqlalchemy] Re: permanent objects and sessions

2007-07-28 Thread MuTPu4
On Jul 28, 5:36 pm, Michael Bayer [EMAIL PROTECTED] wrote: your best option is probably to keep the objects in a session that's specifically for the global objects. Most important is that if you are using multiple threads, you never call flush() on this session. With regards to threadsafety

[sqlalchemy] Newbie question about transactions

2007-07-28 Thread mc
In the following code, I intended that nothing will be inserted into the table because the transaction fails and is rolled back. What actually happens is that the first insert is not rolled back because it s committed by itself. What is the correct way to achieve my goal? TIA from sqlalchemy

[sqlalchemy] Re: Newbie question about transactions

2007-07-28 Thread mc
Thanks. Can you point me to the place in the doc where this is discussed? I was under the impression that I had one connection only in this scenario. TIA On Jul 28, 11:09 pm, Michael Bayer [EMAIL PROTECTED] wrote: On Jul 28, 2007, at 2:54 PM, mc wrote: md=BoundMetaData(db)

[sqlalchemy] Re: Newbie question about transactions

2007-07-28 Thread Michael Bayer
discussion starts here: http://www.sqlalchemy.org/docs/dbengine.html#dbengine_connections covers some options available to you including using a thread local connection. On Jul 28, 2007, at 5:07 PM, mc wrote: Thanks. Can you point me to the place in the doc where this is discussed? I

[sqlalchemy] Re: permanent objects and sessions

2007-07-28 Thread MuTPu4
On Jul 28, 11:08 pm, Michael Bayer [EMAIL PROTECTED] wrote: theres nothing at all wrong with the above; the only adjustments Id make are to a. leave a global session open for your directory.root, and b. remove all cascade rules from the parent relation (in this case using

[sqlalchemy] Re: permanent objects and sessions

2007-07-28 Thread Michael Bayer
On Jul 28, 2007, at 8:46 PM, MuTPu4 wrote: On Jul 28, 11:08 pm, Michael Bayer [EMAIL PROTECTED] wrote: theres nothing at all wrong with the above; the only adjustments Id make are to a. leave a global session open for your directory.root, and b. remove all cascade rules from the parent

[sqlalchemy] querying many-to-many (WordPress)

2007-07-28 Thread Max Ischenko
Hello, I'm using SQLAlchemy to access my WordPress database and I need to query posts from particular category. There is a many-to-many mapping between wp_posts and wp_categories table, throught wp_post2cat table. I was able to come up with the following code: cats =