On Fri, Jan 29, 2010 at 3:38 PM, mickgardner <[email protected]> wrote:
> Is there anything documented on how to use the 'g'? I'm curious...

http://pylonsbook.com/en/1.1/exploring-pylons.html#app-globals-object

There should be a table of the special globals somewhere, but I can't
find it offhand.

'app_globals' (formerly known as 'g') is shared between threads and
requests but is unique to the application instance.  This matters if
there are multiple Pylons applications running in the same process
(i.e., multiple applications under different URLs, as in /blog1 and
/blog2.)  Pylons uses 'app_globals' for Mako's TemplateLookup.  Some
people use it for database connections or external resources, or for a
threadlocal object, a cache of files that have been read, etc.  You
can also put flags in it, especially if they're liable to change
during runtime. (Generally you don't expect 'config' variables to
change.)

This should all be put into the documentation.

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

Reply via email to