[Twisted-Python] Deferred model

Philippe Lafoucrière lafou at wanadoo.fr
Thu Nov 13 09:36:37 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')
> 
> 
> Okay?


Lovely :)

thank you !





More information about the Twisted-Python mailing list