[Twisted-web] problems with data_XXX in formless templates

Federico Di Gregorio fog at initd.org
Thu Feb 24 01:55:53 MST 2005


Il giorno gio, 24-02-2005 alle 09:41 +0200, Tommi Virtanen ha scritto:
> It all seems to relate to using n:data inside the webform.renderForms
> pattern. Don't know what the real problem with that is, or how to fix
> it. If you don't get a more helpful reply from someone else within a
> few days, please file a bug report:
> http://divmod.org/users/roundup.twistd/nevow/

I modified nevow a little bit to spit out debug information and it seems
that it is the generic flatten code that puts the MethodBinding instance
in the context as IData, not the formless code. I'll post some more
information after the nice-afternoon-debugging-session.

Btw, would make sense to have ctx.remember actually check that the given
adapter really support the interfaces it is rememberd for?

> A workaround is to do the data and render outside of the template.
> Slots are one possibility, see attachment.

You workaround is fine right now but, unfortunately, remove one level of
abstraction from what I am trying to do. Using slots means you have to
*explicitly* put in one of the render methods the slot filling code
while using data and (for example) a dict renderer makes possible to
write only one method and put the rendering in the template (I better
like to put simple rendering in the template.)

Thank you very much!
federico

-- 
Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                fog at debian.org
INIT.D Developer                                           fog at initd.org
                             Best friends are often failed lovers. -- Me
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Questa parte del messaggio =?ISO-8859-1?Q?=E8?= firmata
Url : http://twistedmatrix.com/pipermail/twisted-web/attachments/20050224/9b380ac3/attachment.bin


More information about the Twisted-web mailing list