TG2.1: Proper location to store a database session instance?

Posted by Lee Olayvar on Stack Overflow See other posts from Stack Overflow or by Lee Olayvar
Published on 2010-02-21T04:01:48Z Indexed on 2010/05/22 15:50 UTC
Read the original article Hit count: 290

Filed under:
|
|

I am using a custom database (MongoDB) with TG 2.1 and i am wondering where the proper place to store the PyMongo connection/database instances would be?

Eg, at the moment they are getting created inside of my inherited instance of AppConfig. Is there a standard location to store this? Would shoving the variables into the project.model.__init__ be the best location, given that under SQLAlchemy, the database seems to commonly be retrieved via:

from project.model import DBSession, metadata

Anyway, just curious what the best practice is.

© Stack Overflow or respective owner

Related posts about mongodb

Related posts about turbogears