On Jan 16, 2007, at 5:58 AM, Max Ischenko wrote:
Hello,
What is a "recommended" way to work with multiple database through
SqlAlachemy?
I can use pylons.database.make_session() to create session explicitly
but what about automatic management (akin to what session_context
provides)?
You'll want to setup another session_context similar to how the main
one is setup in pylons.database.
For example, in one of your models modules:
from paste.deploy import CONFIG
from sqlalchemy.ext import sessioncontext
from pylons.database import app_scope, make_session
dburi2 = CONFIG['app_conf']['sqlachemy.dburi2']
session_context2 = sessioncontext.SessionContext(lambda: make_session
(dburi2),
scopefunc=app_scope)
--
Philip Jenvey
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---