The actual connection is done via setup_sqlalchemy in the AppConfig object see configuraiton.py for details.
Basically, you can create a subclass of AppConfig.py with a new setup_sqlalchemy method that does whatever you want. We *should* document this in our standard sphinx documentation, but it seems that everybody has been pretty busy. --Mark Ramm On Mon, May 25, 2009 at 4:33 AM, dakila <[email protected]> wrote: > > yes, I read it, sorry if its not obvious to me. But still have no idea > regarding the next steps after creating a second MetaData. Basically > how would I create the second sqlalchemy.url and other stuff to > indicate the second database to connect to, etc. > > On May 25, 1:32 pm, Jorge Vargas <[email protected]> wrote: >> On Sat, May 23, 2009 at 9:09 AM, dakila <[email protected]> wrote: >> >> > Hi All, >> >> > How do I connect to two databases in tg2? I have been reading the >> > information in [1,2], but have no idea how to do it in a quickstarted >> > tg2 application. >> >> Did you read the comments in the model.__init__.py it's pretty much >> setup for you. Just create a second metadata >> >> > [1]http://wiki.pylonshq.com/display/pylonsdocs/Using+SQLAlchemy+with+Pylons >> > [2]http://www.sqlalchemy.org/docs/04/session.html#unitofwork_contextual_... >> >> > Regards, >> > Dax >> >> > > > -- Mark Ramm-Christensen email: mark at compoundthinking dot com blog: www.compoundthinking.com/blog --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" 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-trunk?hl=en -~----------~----~----~----~------~----~------~--~---
