Ah, right! I now realize app_globals is unnecessay. Using the
pylons.config in the new module works just fine (as it should).

Thanks, Wyatt.

cheers,
gsk.

On Sep 8, 11:26 pm, Wyatt Baldwin <[email protected]> wrote:
> On Sep 8, 1:28 pm, Mike Orr <[email protected]> wrote:
>
>
>
> > On Tue, Sep 8, 2009 at 1:17 PM, gsk<[email protected]> wrote:
>
> > > Hi,
> > > Newbie question: I am using SqlAlchemy for Postgresql backend. I have
> > > setup a schema in the db where all the tables I need exist. So, I have
> > > the ORM class as below where I would dynamically pass the value for
> > > the schema:
>
> > > class Foo(Base):
> > >    __tablename__ = 'foo_table'
> > >    __table_args__ = {'schema': someschema}
>
> > > ...
>
> > > I have put the db schema value in test.ini file hoping to use
> > > pylons.config. But, apparently, Pylons config object is not yet setup
> > > when model/__init__.py is initialized. Any suggestions on how I could
> > > get around this? (I've hardcoded the schema at the moment but need to
> > > parameterize as the dev and test environments use different postgresql
> > > schema spaces)
>
> > Er, I'm not sure if you can do that.
>
> If you're careful with your imports, this should be possible.
>
> For example, you could define your Foo class in model/foo.py, then
> make sure that model.foo isn't imported until after app initialization
> occurs (i.e., after make_app runs). This should be pretty easy if you
> only import model.foo from your controller modules.
--~--~---------~--~----~------------~-------~--~----~
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