[Twisted-Python] Deferred model
Philippe Lafoucrière
lafou at wanadoo.fr
Thu Nov 13 09:39:42 MST 2003
> from twisted.web.woven.page import Page
> from twised.internet import defer
>
> class OurPage(Page):
> template = '''<html><body>
> <p model="deferredModel" view="Text"></p>
> </body></html>'''
> def wmfactory_deferredModel(self, request):
> """ returns an already callbacked
> Deferred with the string 'Hello world' as it's result
> """
> return defer.succeed('Hello world')
Last question (sry, I'm still a newbie in twisted :p) :
where do I put my blocking code ? just before the defer.succeed ??
More information about the Twisted-Python
mailing list