[Zope] Probably simple problem...

Thierry FLORAC tflorac@onf.fr
Wed, 26 Sep 2001 15:54:22 +0200


Hi,

another little problem I encounter while discovering Zope.
I want to have such folders and objects :

  /dsi
    content_html (DTML Method)
  /news
    content_html (DTML Method)
    get_last_news (Z SQL Method)

The "/news/content_html" method is using the "get_last_news" SQL method, in
a <dtml-in get_last_news>...</dtml-in> loop.
In the "/dsi/content_html", I want to include the result of the
"/news/content_html" method, so I placed <dtml-var
expr="news.content_html()"> in this script but when trying to view the
result, I get a KeyError on "get_last_news", with the following traceback :

Traceback (innermost last):
  File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 223, in
publish_module
  File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 187, in publish
  File /usr/lib/zope/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
    (Object: Traversable)
  File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 171, in publish
  File /usr/lib/zope/lib/python/ZPublisher/mapply.py, line 160, in mapply
    (Object: content_html)
  File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 112, in
call_object
    (Object: content_html)
  File /usr/lib/zope/lib/python/OFS/DTMLMethod.py, line 189, in __call__
    (Object: content_html)
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_String.py, line 549, in
__call__
    (Object: content_html)
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_Util.py, line 339, in
eval
    (Object: news.content_html())
    (Info: news)
  File &lt;string&gt;, line 0, in ?
  File /usr/lib/zope/lib/python/OFS/DTMLMethod.py, line 182, in __call__
    (Object: content_html)
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_String.py, line 549, in
__call__
    (Object: content_html)
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_In.py, line 652, in
renderwob
    (Object: get_last_news)

Where did I made any mistake ??
What's the right way to use scripts and methods in such a (probably basic
!) way...??

Thank you for any help.
Thierry