[Twisted-web] Context Help

Michael M m.milvo at gmail.com
Sat Sep 10 02:05:07 MDT 2005

Thanks in advance for any help.

My problem is getting context to remember things.  If I remember
something when the context is PageContext, I cannot retrieve it when
the context changes to say WebContext because it tells me that it has
not been remembered.

Now, I was under the impression that context would search for my
interface through the different contexts but this does not seem to be
the case. This kind of limits what I can do with context because I
have no idea when the context changes and my rememberances will be

Example Problem

def render_cow(self, ctx, data):
    ctx.remember(data, ISomeInterface)

def render_something_else(self, ctx, data):
    mydata = ctx.locate(ISomeInterface)

Now in between remebering ISomeInterface and recalling it the context
changes and it is no longer remebered.

My apologies if I am way out with my understanding and any help is appreciated.


More information about the Twisted-web mailing list