[Twisted-Python] Woven and submodelling through deferreds
syver at inout.no
Thu Aug 7 06:03:48 EDT 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>
More information about the Twisted-Python