Yes, that creates the 'app_globals' object. That's required. I'm not sure what Pylons would do if that's not there; maybe raise an exception when it registers the StackedObjectProxy.
I'm essentially talking about modifying the template namespace to add more top-level variables. But the answer seems to be that you'd have to write your own render_mako. --Mike On Mon, Dec 21, 2009 at 1:38 AM, Damian <[email protected]> wrote: > Good question - I don't think I do anything special for that, beyond > the default in config/environment.py: > > config['pylons.app_globals'] = app_globals.Globals() > > I think its there by default? > > Damian > > On Dec 21, 3:00 am, Mike Orr <[email protected]> wrote: >> > On Dec 20, 9:05 pm, Mike Orr <[email protected]> wrote: >> >> How do you add variables to the globals? I think you'd have to >> >> override render_mako. >> On Sun, Dec 20, 2009 at 2:51 PM, Damian <[email protected]> wrote: >> > you define them in the Global object. >> >> > class Globals(object): >> > myconstant = 'astring' >> >> Ah, I meant something different. I meant, how do you put 'g' into the >> template namespace, if you like it better than 'app_globals'? The >> globals are returned by pylons.templating.pylons_globals(), which >> render_mako merges into the template namespace. So it looks like you'd >> have to override render_mako, since there's no way to plug >> customization into the function. >> >> -- >> Mike Orr <[email protected]> > > -- > > 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. > > > -- Mike Orr <[email protected]> -- 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.
