[Zope] Zope product and dtml-tree

Tim Nash thedagdae at gmail.com
Thu Jul 31 12:33:26 EDT 2008


Rowan,
   Can you try inheriting from dtml-document instead of simple-item? I use
dtml document as much as I can. It is a big object but you almost always
need to call a dtml object anyway. And all the methods are already battle
tested. (BTW, for me zope is almost entirely the model, and the view and
most of the controller are in the browser so I am not as concerned about
mixing content with logic inside zope. ymmv)

dtml-tree is cool but it can be flakey

-Tim


On Wed, Jul 30, 2008 at 12:13 PM, Rowan Woodhouse <
rwoodhouse at wirelessmeasurement.com> wrote:

> Hi,
>
> I'm developing a Zope product that uses a dtml file to generate the html
> page. I'd like to include a dtml-tree based tree for navigation on the page.
> The custom object inherits from SimpleItem. When I include the follow code
> in the dtml file:
>
> <dtml-tree>
>  <dtml-var id>
> </dtml-tree>
>
> I get the following exception:
>
> An error was encountered while publishing this resource.
>
> exceptions.KeyError
> Sorry, a site error occurred.
>
> Traceback (innermost last):
>
>    * Module ZPublisher.Publish, line 202, in publish_module_standard
>    * Module ZPublisher.Publish, line 150, in publish
>    * Module ZPublisher.Publish, line 119, in publish
>    * Module ZPublisher.mapply, line 88, in mapply
>    * Module ZPublisher.Publish, line 42, in call_object
>    * Module Products.WellGroup.WellGroup, line 110, in index_html
>    * Module App.special_dtml, line 65, in __call__
>    * Module DocumentTemplate.DT_String, line 476, in __call__
>    * Module TreeDisplay.TreeTag, line 88, in render
>    * Module TreeDisplay.TreeTag, line 192, in tpRender
>
> KeyError: 'URL'
>
> If I add a class variable called URL I then get a key error for RESPONSE.
>
> My understanding from documentation is that Item (from which SimpleItem
> inherits) gives the product basic dtml-tree support. I can't find any
> examples that spell out how to write a product that supports dtml-tree tags.
> Could someone point me in the right direction?
>
> Thanks,
> Rowan
>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20080731/29bdfd70/attachment.html


More information about the Zope mailing list