[Twisted-Python] viewStack breakage

Donovan Preston dp at twistedmatrix.com
Thu Oct 31 09:44:56 MST 2002


If you look in the commit, you'll see a comment about this problem...

         # This works for simple cases, unfortunately this widget 
doesn't have
         # appropriate mvc stack -- it only has itself

I'm going to have to copy the stack each time I create a widget and 
store it in the widget so that later when a widget gets a modelChanged 
notification, the correct stuff is on the stack. Doing this will also 
help with Deferreds -- they'll run in to the same problem right now, 
when the deferred fires they won't have the proper things on the stack.

I might get to this today, but I might not.

Donovan

On Thursday, October 31, 2002, at 06:48 AM, Paul Boehm wrote:

> hey, thanks for fixing the caching bug that quickly!
>
> i think something else broke with your last few commits though:
>
> this debug output is from getNodeView for a GET request, with no 
> controllers
> working. i have a wvfactory_DetailLink in sam.web.serverlist.View, 
> which the
> viewStack finds without problems:
>
> 31/10/2002 15:41 [*samclient*] [<twisted.web.woven.widgets.KeyedList 
> instance at 0x83c17e4>, <twisted.web.woven.widgets.DefaultWidget 
> instance at 0x83e6674>, <twisted.web.woven.widgets.DefaultWidget 
> instance at 0x83e45ac>, <sam.web.serverlist.View instance at 
> 0x83ae814>, <module 'twisted.web.woven.widgets' from 
> '/home/paul/Twisted/twisted/web/woven/widgets.pyc'>]
>
> now when i submit data to my controller, i get a different viewStack
> exceptions.NotImplementedError: You specified view name DetailLink on 
> a node, but no factory_DetailLink method was found in 
> [<twisted.web.woven.widgets.DefaultWidget instance at 0x840963c>, 
> <twisted.web.woven.widgets.KeyedList instance at 0x83db2bc>, <module 
> 'twisted.web.woven.widgets' from 
> '/home/paul/Twisted/twisted/web/woven/widgets.pyc'>].
>
> without sam.web.serverlist.View.
>
> the relevant xhtml snippet for this is:
>         <ul model="root/inventory" view="KeyedList">
>             <li id="emptyList">No Servers defined</li>
>             <li id="keyedListItem">
>                 <a view="DetailLink" model="name">
>                 <span view="Text" model="name" /></a>
>             </li>
>         </ul>
>
> root is a dictionary in my serverlist.Model, which has serverlist.View
> registered as View.
>
> inventory is a Dictionary like class, which has registered for a
> DictionaryModel Wrapper with components.
>
> as inventory is only a virtual model, imho the parent's view should
> propagate down to it's viewStack, which seems to work, unless a 
> controller
> updates inventory.
>
> what's needed to fix this? do i need to make inventory and/or root
> a real model and register a view for it ?
>
>   paul
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python





More information about the Twisted-Python mailing list