[Twisted-Python] Woven and submodelling through deferreds

Syver Enstad syver-en at online.no
Tue Aug 5 12:41:43 MDT 2003


I asked on the #twisted irc channel today about this, and Itamar
answered that it was possible but maybe only in CVS, I was also
directed to this list as the proper channel to ask woven questions.

I have the following setup:

class MyPage(page.Page):
   def wmfactory_myClass....
       ... some code that does a asynch operation and return a deferred
       deferred.addCallback(self._cbMyClass)
       return deferred
   
   def _cbMyClass(self, result):
       return MyClass(result)


class MyClass(model.MethodModel):
   def wmfactory_listing(......
       return [.......]


template:

<span model="myClass" view="None>
  <table model="listing" view="List">
        ....
  </table>
</span>

I get an error that the view cannot find the submodel, listing. The
modelStack is [DeferredWrapper, MyPage]. 

I use Twisted 1.0.6.

So my question is: How can I use deferreds the way I am outlining
here? Or is there a simple workaround?

-- 

Vennlig hilsen 

Syver Enstad





More information about the Twisted-Python mailing list