[sqlalchemy] Sessions, threads, cherrypy visibility

2012-01-17 Thread John Hufnagle
Didn't see an answer to this in the discussions. I have: 1. slqlchemy 0.7.3, cherrypy and mysql Ver 14.14 Distrib 5.5.18, for osx10.6 2. a cherry py application that initializes the scoped session as: Session = scoped_session(sessionmaker(bind=engine)) 3a. Passes that Session instance into a

[sqlalchemy] Many-to-Many best practice

2011-12-12 Thread John Hufnagle
I am developing a REST web service with a Parent, Child many-to-many relationship. If I have an existing Parent with a relationship collection of Child objects and as an example: Existing Parent 1 has children associations Child 1 (id=1), Child 2(id=2) And I receive an Update call to the web

[sqlalchemy] cherrypy SA 0.7 scoped_session

2011-12-08 Thread John Hufnagle
I've been beating my head over this one. I read the ORM Creating a Thread-local Context doc and the web but don't see a simple answer...saw some old SA/Cherrypy code that used cherrypy 'tools' etc. The SA doc seems straightforward but I keep getting sqlalchemy.exc.UnboundExecutionError errors.

[sqlalchemy] Re: cherrypy SA 0.7 scoped_session

2011-12-08 Thread John Hufnagle
Thanks Michael, Could not find a hidden Session object. So I broke it down into a problem that works/doesn't work based on files separation 1. If I place all of the code into one file all_in_one.py which contains the cherrypy startup, the SA init code and ORM object and the cherrypy REST

[sqlalchemy] Re: cherrypy SA 0.7 scoped_session

2011-12-08 Thread John Hufnagle
getting the 'Session' you created in two_file_server.py, but rather a new blank one from the import statement. Hope that helps, --diana On Thu, Dec 8, 2011 at 8:41 PM, John Hufnagle johnjhufna...@gmail.com wrote: Thanks Michael, Could not find a hidden Session object. So I broke it down