Hi all --

First, I have a few questions.

1) When I create a controller class for a page, does that class get
instantiated into a new object every time someone goes to the page, or
does it only get instantiated by root.py so that any subsequent
loading of a page just calls the .index() method on that object?
2) Where is the "correct" place to define my sqlalchemy session
factory (session = scoped_session(..))?

Now on to the issues I'm having...

I'm running a Turbogears 2.0 app. In my app, a particular controller
does some sqlalchemy queries, and then passes the results (sqlalchemy
objects) to the template so the template can decide what data to
display. The strange thing is, if I open the same page in two separate
tabs and reload them both simultaneously, only one of the pages
succeeds in loading. The others give me errors that suggest that the
template is not receiving the database objects that I pass to the page
through the return dictionary. At the very bottom of the controller,
just before the return, I added a print statement that prints the
dictionary -- they are always identical, even though one page fails to
load (it gives me a KeyError, saying that one of the database objects
that I returned isn't in the dictionary). Also, it is always the page
that I reloaded first that fails.

Does anyone have any idea how one page using sqlalchemy objects can
affect another instance of the same page?

Thanks!
- Adrian

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to