Hi all,
I cann't find a working example on how to use lib/app_globals.py to
provide global variables to the application. I tried setting variables
in the __init__() or just adding them to the class, but when I try to
access them in the controller, I cann't get any values back. I assumed
the following would work:
lib/app_globals.py:
class Globals(object):
def __init__(self):
self.key = "1234"
key = "1234"
controllers/root.py:
from tg import g
print g.key
But that just produces an error that g has no member named 'key'. What
is the correct way here?
--
Aigars Mahinovs <[email protected]>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---