[Twisted-Python] Woven and submodelling through deferreds
Donovan Preston
dp at twistedmatrix.com
Tue Aug 5 16:54:10 MDT 2003
On Tuesday, August 5, 2003, at 3:38 PM, Syver Enstad wrote:
<snip>
> Thanks Donovan, that did the trick. Great, I've done some pretty gross
> hacks to get around that problem, it was about time I learned how to
> do it.
>
> Regarding views, how do I find out what views one should use? What is
> the default view (or isn't there such a thing)? When should one use
> Widget and when should one use None? Are there any documents on things
> like this?
You can look in widgets.py to see what basic widgets are available.
view="None" is aliased to DefaultWidget by the view-lookup machinery.
You can see by the volume of code in Widget vs. DefaultWidget that
widget is a lot more functional. DefaultWidget is supposed to exist
only to minimize the amount of processing that happens on Widgets that
aren't doing any work. DefaultWidget doesn't know a thing about
deferreds but Widget does, which is why you had your problem.
I consider it a bug that you had to say view="Widget" in your case;
normally you shouldn't be required to know about implementation details
of Widgets in order to get deferred-model support to work.
Someone could even file a bug which says something like "DefaultWidget
needs to know about Deferreds"
dp
More information about the Twisted-Python
mailing list