[Twisted-Python] Woven and submodelling through deferreds

Donovan Preston dp at twistedmatrix.com
Wed Aug 6 22:44:01 EDT 2003


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:

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

dp





More information about the Twisted-Python mailing list