Hello everyone,

i like to suggest a little feature, which comes in pretty handy i
think. I'd like to see a defaultarg argument in the web.application
class. This variable is then passed to each page as the first
argument.
Example:
[...]
class Environment:
    [...]

class Index:
    def GET(self, env):
        return env.render_template(...) # for example

env = Environment()
app = web.application(URLS, globals(), defaultarg=env)

This is useful for keeping often used classes and variables together
and have them available in the page class. I know that you could make
the environment class a global variable but then it would be difficult
to split the classes into different files.
Perhaps this is also possible with the help of application processors
and if you know how to do that please tell me!

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en.

Reply via email to