paolo_veronelli at libero.it
Tue May 3 03:20:51 MDT 2005
gerardo arnaez wrote:
>I have slowly been working my way through the nevow examples
>I have start look at the base classes to understand what is going on,
>but Im still stuck on what "context" is supposed to mean
>in say (self, context,data)
>I understand self, and understand data,
>but dont understand the function or what the argument *context* is doing?
>I have been going thought the examples and it is just not clear.
>Any enlightening insight would be much appreciated
#The context in which the rendering is happening.
#Apart from very useful information you can already get from it:
from nevow.inevow import IRequest
from nevow import rend
#you can pass your own to it
from nevow import compy
content="this is something I want all the methods in this rendering
process to get known about"
# all the rendering methods called after that can retrieve the 'content'
from context with IContent(context)
Probably there are more useful things context is supposed to be used for
More information about the Twisted-web