[Zope] Struggle to call a Zclass object from another web
object
Dylan Reinhardt
zope@dylanreinhardt.com
Thu, 13 Mar 2003 07:18:05 -0800
The problem is you're having is not the problem you think you're having. :-)
You're getting an error for standard_html_header. Zope hasn't gotten to
parse the expression you're fiddling with yet, so don't be surprised if
what you're doing continues to produce errors.
Tracebacks are a very good thing to get in the habit of reading. Typically
the most important information is contained in the last couple steps,
though in Zope, it's sometimes the case that the real error is five or six
steps in.
In this case your error is right on the last line:
Module DocumentTemplate.DT_String, line 474, in __call__ KeyError:
standard_html_header
When objects get rendered, the __call__ method is typically used on
them. Everything to the left of that is unlikely to be useful to you until
you get to the point where you're modifying source code. Looking to the
right of __call__, a KeyError usually pops up when an object name can not
be resolved by Zope. This error is telling you that Zope was unable to
find the standard_html_header object.
So make sure there is a standard_html_header in your root folder that you
have permissions to view it. That should fix the problem... or at least,
it will get you along to the next one. :-)
HTH,
Dylan
At 02:09 AM 3/13/2003, pieter claassen wrote:
>Hello,
>
>
>I guess I still don't get Zope completely.
>
>I wrote a news manager Zclass that works well. Normally I get to the
>object by calling the newster/index_html method (the default behaviour).
>
>I want to integrate it into my website and in my root directory I have
>the following objects:
>
>index_html (dhtml object)
>menu (dhtml object)
>top (dhtml object)
>news (Zclass object)
>
>I want to do use my index_html to do pull all these objects together on
>a single page like:
>
><dtml-var standard_html_header>
><dtml-var top>
><table border="0" cellspacing="0" cellpadding="0">
><tr>
><td>
><dtml-var menu>
></td>
><td><dtml-var news></td>
></tr>
></table>
><dtml-var standard_html_footer>
>
>But, clearly calling <dtml-vat news> just doesn't call the index_html
>method on the news object and include the result.
>
>I have tried things like <dtml-var expr="news.index_html()"> and that
>get an error that
>
>Traceback (innermost last):
>
> * Module ZPublisher.Publish, line 98, in publish
> * Module ZPublisher.mapply, line 88, in mapply
> * Module ZPublisher.Publish, line 39, in call_object
> * Module OFS.DTMLMethod, line 126, in __call__
> * Module DocumentTemplate.DT_String, line 474, in __call__
> * Module DocumentTemplate.DT_Util, line 201, in eval
> __traceback_info__: newster
> * Module <string>, line 2, in f
> * Module OFS.DTMLMethod, line 119, in __call__
> * Module DocumentTemplate.DT_String, line 474, in __call__
>KeyError: standard_html_header
>
>Somebody out there must have solved this problem? Any help is
>appreciated.
>
>Thanks,
>Pieter
>
>
>_______________________________________________
>Zope maillist - Zope@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 )