On 3/30/07, Jose Galvez <[EMAIL PROTECTED]> wrote:
> Hi all,
> I just started using the pylons.database methods for one of my projects
> and I've come across what I think is a problem (or rather jut something
> I don't know how to deal with)  The project requires two different
> models connecting to two different database server with two different
> users.   Specifically I will be connecting to a mysql database and an
> oracle database.  I didn't design the databases, and at lease on the
> oracle side its read only.  I was hopping to user sqlalchemy to model
> the data, but how do I connect to them both? The docs say that the
> default database reference is sqlalchemy.url (I may this worng, but no
> matter) Can I just create a second one for oracle say oracle.url and
> connect to it explicitly with
> make_engine(g.pylons_config.app_conf['oracle.url'] ?  I've tried it yet
> just thought I would ask first.  Also is g available to use in models,
> or do I have t import it first (from pylons import g)?  Thanks for any
> and all help.

I don't know the perfect answer to your question.  However, you won't
be able to access "g" from within models/__init__.py just by importing
it, I don't think.  In my document here,
http://pylonshq.com/project/pylonshq/wiki/SqlAlchemyWithPylons, I talk
about how to pass the config to the model.

Best Regards,
-jj

-- 
http://jjinux.blogspot.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to