On Jan 30, 9:40 am, Jorge Godoy <[EMAIL PROTECTED]> wrote:
> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> > Well, first I added this to my model:
>
> > tracker_engine = create_engine('postgres://vrst_tracker:{Q]&L]$;!
> > @tranquility.techsupport.local:5432/vrst_tracker')
> > tracker_metadata = DynamicMetaData(name="Tracker Metadata")
> > tracker_metadata.connect(tracker_engine)
> > trackerissue_table = Table('_issue', tracker_metadata, autoload=True)
> > trackerclient_table = Table('_client', tracker_metadata,
> > autoload=True)
> > session.bind_table(trackerissue_table, tracker_engine)
> > session.bind_table(trackerclient_table, tracker_engine)
> > assign_mapper(session.context, TrackerIssue, trackerissue_table)
> > assign_mapper(session.context, TrackerClient, trackerclient_table)
>
> >>From the "tg-admin" shell, doing this works:
>
> > issues = TrackerIssue.select()
>
> > So I can access both databases. When I do the same method inside of a
> > controller method, it throws the query against the wrong database and
> > I get a ProgrammingError.I must be blind, but I'm only seeing one database 
> > there: vrst_tracker.
>
> Where's the other one?
>
> And a ProgrammingError is an exception raised from PostgreSQL's psycopg
> driver.

Sorry, I should have been more clear. The other database is accessed 
using the normal TG way, configuration is in dev.cfg. The 
ProgrammingError is because the query is trying to fetch a table that 
doesn't exist in that context. (Wrong DB)

A.


--~--~---------~--~----~------------~-------~--~----~
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