Re: [sqlalchemy] Wiki system with parent pages (many to many relation to itself) problems

2010-10-18 Thread Michael Bayer
On Oct 18, 2010, at 9:04 PM, Michael Bayer wrote: > > did you try removing that unneeded "remote_side" argument ? I wonder why > even it accepts remote_side or does anything with it when secondary is > present. ...nope. works fine. you need to provide a real test case.All tabl

Re: [sqlalchemy] Wiki system with parent pages (many to many relation to itself) problems

2010-10-18 Thread Michael Bayer
On Oct 18, 2010, at 6:08 PM, Sh4wn wrote: > Hi guys, > > I'm trying to create a wiki system, and each wikipage can have one or > more parent pages. This is basicly a many to many relation to the same > table. > > I tried the following: > http://pastebin.com/pvNEUeYR > > Unfortunately this does

[sqlalchemy] Wiki system with parent pages (many to many relation to itself) problems

2010-10-18 Thread Sh4wn
Hi guys, I'm trying to create a wiki system, and each wikipage can have one or more parent pages. This is basicly a many to many relation to the same table. I tried the following: http://pastebin.com/pvNEUeYR Unfortunately this doesn't fully work. Inserting works quite well, and querying too, bu

[sqlalchemy] Re: "(OperationalError) no such column" when eagerload an association object that has custom secondaryjoin condition in 0.5.8

2010-10-18 Thread Jasper K
On Oct 18, 4:06 pm, Michael Bayer wrote: > On Oct 18, 2010, at 2:46 PM, Jasper K wrote: > > > > > Hi Group, > > > I am using SqlAlchemy 0.5.8 > > > I get an "(OperationalError) no such column: child.child_id" error > > when trying to eagerload a viewonly many-to-many relationship that > > uses th

Re: [sqlalchemy] "(OperationalError) no such column" when eagerload an association object that has custom secondaryjoin condition in 0.5.8

2010-10-18 Thread Michael Bayer
On Oct 18, 2010, at 2:46 PM, Jasper K wrote: > Hi Group, > > I am using SqlAlchemy 0.5.8 > > I get an "(OperationalError) no such column: child.child_id" error > when trying to eagerload a viewonly many-to-many relationship that > uses the Association Object pattern with a custom secondaryjoin

Re: [sqlalchemy] Re: Rollback not working like I expect it to (sort of)

2010-10-18 Thread Michael Bayer
On Oct 18, 2010, at 3:10 PM, Russell Warren wrote: > Thanks... I don't think my question stemmed from a lack of reading the > extensive sqlalchemy documentation, but more of a limitation on my > understanding of how sqlite works (or doesn't) with nested > transactions. I know that you need the S

[sqlalchemy] Re: Rollback not working like I expect it to (sort of)

2010-10-18 Thread Russell Warren
Thanks... I don't think my question stemmed from a lack of reading the extensive sqlalchemy documentation, but more of a limitation on my understanding of how sqlite works (or doesn't) with nested transactions. I know that you need the SingletonThreadPool or nested sessions completely block on the

[sqlalchemy] "(OperationalError) no such column" when eagerload an association object that has custom secondaryjoin condition in 0.5.8

2010-10-18 Thread Jasper K
Hi Group, I am using SqlAlchemy 0.5.8 I get an "(OperationalError) no such column: child.child_id" error when trying to eagerload a viewonly many-to-many relationship that uses the Association Object pattern with a custom secondaryjoin condition (http://www.sqlalchemy.org/docs/05/mappers.html#ass

Re: [sqlalchemy] creating tables and mappers multiple times in the same python script

2010-10-18 Thread Michael Bayer
On Oct 18, 2010, at 5:36 AM, Faheem Mitha wrote: > > Hi, > > I should say in advance that I don't have a reproduction script for this, > though I could probably manufacture one if necessary. > > I have a python script which calls a function repeatedly. Each time the > function is called, it

Re: [sqlalchemy] Rollback not working like I expect it to (sort of)

2010-10-18 Thread Michael Bayer
On Oct 18, 2010, at 12:41 PM, Russell Warren wrote: > > #sess2 will add a new user (jack), but we'll roll it back in the end > sess2 = Session() > jack = User('jack') > jack.addresses = [Address(email_address='j...@example.com'), > Address(email_address='j...@example.org')] > se

[sqlalchemy] Rollback not working like I expect it to (sort of)

2010-10-18 Thread Russell Warren
If I: 1) start a session (sess1) 2) store some data to sess1 without commit 3) start a second session and link to uncommited data from sess1 4) do a rollback on sess1 I'm finding that the rollback does absolutely nothing - the sess1 data persists after the rollback. It is making me not trust rol

Re: [sqlalchemy] Checking the availablity of a booked Item

2010-10-18 Thread chaouche yacine
Hello, I think outerjoin is just a join with an isouter = True, and above all the problem was not there anyway. The problem was only about ordering the joins. The correct python code was : Face.query.outerjoin(Face.bookings).filter(cond).all() instead of Face.query.outerjoin(Booking.faces).fi

[sqlalchemy] creating tables and mappers multiple times in the same python script

2010-10-18 Thread Faheem Mitha
Hi, I should say in advance that I don't have a reproduction script for this, though I could probably manufacture one if necessary. I have a python script which calls a function repeatedly. Each time the function is called, it creates a bunch of SQLA tables, classes and mappers between them