[Twisted-Python] Woven and submodelling through deferreds

Syver Enstad syver at inout.no
Thu Aug 7 04:03:48 MDT 2003


Donovan Preston <dp at twistedmatrix.com> writes:

> On Wednesday, August 6, 2003, at 4:42 PM, Syver Enstad wrote:
> >
> > Should this work?
> >
> > In some template:
> >     <tr>
> >         <td model="deferredModel/One" view="Text">List item here</td>
> >         <td model="deferredModel/Two" view="Text">List item here</td>
> >     </tr>
> >
> > class MyModel(MethodModel):
> >     def wmfactory_deferredModel(self, request):
> >         .....
> >         return deferred # promises to be a dictionary
> >
> >
> > As it is now this fails in lookupSubmodel / getSubmodel, because the
> > DeferredWrapper has not got a submodel named One.
> 
> This will not work, and I can't justify the effort required to make it
> work. Do it like this instead:

The view must be Widget in my experience because DefaultWidget doesn't
handle deferreds in generate.

> <tr model="deferredModel" view="None">
<tr model="deferredModel" view="Widget">
> 	<td model="One">...</td>
> 	<td model="Two">...</td>
> </tr>







More information about the Twisted-Python mailing list