That's awkward when you have a lot of config data. You'd have to manually copy it all somewhere (app_globals) into Globals, which is essentially boilerplate code. The right thing to do would be, as OP requested, to let every module access easily and consistently the part of configuration this module cares about - no clutter and fat that way.
Sergey Lipnevich napisaĆ(a): > I think the "pattern" that's being encourages is to only access > configuration once in app_globals.py, that's why Globals.__init__ gets > a reference to it. Anything you need later must become Globals member > variables accessible everywhere via "g" proxy. > > Sergey. > > On 11/8/06, Shannon -jj Behrens <[EMAIL PROTECTED]> wrote: > > > > To some degree, I understand the extreme fear of global variables in > > Pylons. However, getting access to app_conf in certain places can be > > a real pain. > > > > * In controllers, you can use "g.pylons_config.app_conf". > > > > * In app_globals, __init__ receives a reference to it. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
