[Twisted-Python] Interfaces and adapters

en.karpachov at ospaz.ru en.karpachov at ospaz.ru
Sat Aug 27 07:52:49 MDT 2005


On Sat, 27 Aug 2005 13:47:58 +0200
Valentino Volonghi aka Dialtone wrote:

> twisted.web2 is yet to come and also nevow working on it although
> there's a branch in nevow
> that works with it right now. So everything is in flux and yet to be
> decided.

Of course, I'm aware of that but I couldn't help but try it right now :)

> If you want to really use sessions in nevow you have to use guard, if
> you use guard the session
> object will be GuardSession that knows about nevow and can implement
> inevow.ISession.
> Currently GuardSession doesn't implement inevow.ISession but will in a
> sec when I commit the fix.

Good news, thanks! I'd like to operate with interfaces, not with
implementation classes:

registerAdapter(MyUserInfo, ISession, IMyUserInfo)

> If you don't use guard you are really getting a server.Session object
> from twisted.web returned by
> nevow.appserver.sessionFactory that calls NevowRequest.getSession()
> which will return the GuardSession
> if you are using guard or the other one if not (as I already said). Oh,
> server.Session does suck.

Ok. I didn't know that using guard is mandatory for sessions in the Nevow,
but now I do. Deprecation warning about twisted.web.server.Session as the
default adapter would be nice, eventually.

Thanks for the suggestion.

-- 
jk




More information about the Twisted-Python mailing list