[Zope] Problem: Calling DTML Method from ZPT
Mike Murphy
Mike Murphy" <mike@flipper.eskimo.net
Fri, 3 Aug 2001 18:21:15 -0700
Steve,
I still got a TALES error in trying what you suggested:
<p tal:replace="structure
python:root.games.hangman.index_html(root.games.hangman)"/>
But it is a different error than before... a "guarded getitem" error...
Mike
...
File /opt/Zope/lib/python/Products/PageTemplates/ZRPythonExpr.py, line 121,
in __call__
(Info: root.games.hangman.index_html(root.games.hangman))
File Python expression
"root.games.hangman.index_html(root.games.hangman)", line 2, in f
(Object: guarded_getattr)
File /opt/Zope-2.4.0-linux2-x86/lib/python/OFS/DTMLMethod.py, line 194, in
__call__
(Object: index_html)
File /opt/Zope-2.4.0-linux2-x86/lib/python/DocumentTemplate/DT_String.py,
line 544, in __call__
(Object: index_html)
File /opt/Zope-2.4.0-linux2-x86/lib/python/OFS/DTMLMethod.py, line 187, in
__call__
(Object: standard_html_header)
File /opt/Zope-2.4.0-linux2-x86/lib/python/DocumentTemplate/DT_String.py,
line 544, in __call__
(Object: standard_html_header)
File /opt/Zope-2.4.0-linux2-x86/lib/python/DocumentTemplate/DT_With.py,
line 148, in render
(Object: images)
File /opt/Zope-2.4.0-linux2-x86/lib/python/DocumentTemplate/DT_Var.py,
line 280, in render
(Object: PARENTS[-1].applications.guestbook.entryForm)
File /opt/Zope-2.4.0-linux2-x86/lib/python/DocumentTemplate/DT_Util.py,
line 230, in eval
(Object: PARENTS[-1].applications.guestbook.entryForm)
(Info: PARENTS)
File <string>, line 2, in f
(Object: guarded_getitem)
TALESError: (see above)
----- Original Message -----
From: "Steve Spicklemire" <steve@spvi.com>
To: "Mike Murphy" <mike@flipper.eskimo.net>
Cc: "Steve Spicklemire" <steve@spvi.com>; <zope@zope.org>
Sent: Friday, August 03, 2001 4:13 PM
Subject: Re: [Zope] Problem: Calling DTML Method from ZPT
> Hi Mike,
>
> try:
>
> < p tal:replace="structure
> python:root.games.hangman.index_html(root.games.hangman)"/>
>
> -steve
>
> On Friday, August 3, 2001, at 05:19 PM, Mike Murphy wrote:
>
> > Hi! I am having problems executing a DTML Method from a ZPT. I have
> > been
> > unable to find documentation regarding whether this is even possible or
> > not.
> > Here are a couple of examples:
> >
> > <!-- With this snippet, I get the DTML unrendered: -->
> > <p tal:replace="python:root.games.hangman.index_html"></p>
> >
> > <!-- With this snippet, I get a TALES error and a big stack trace: -->
> > <p tal:replace="root/games/hangman/index_html"></p>
> >
> > Anybody have any ideas what it is that I am doing wrong? I like ZPT
> > conceptually, and ran into this snag while converting some of my
> > DTML. (I
> > am running Zope 2.4.0 with the latest hotfix.)
> >
> > Mike
> >
> >
> >
> > _______________________________________________
> > Zope maillist - Zope@zope.org
> > http://lists.zope.org/mailman/listinfo/zope
> > ** No cross posts or HTML encoding! **
> > (Related lists -
> > http://lists.zope.org/mailman/listinfo/zope-announce
> > http://lists.zope.org/mailman/listinfo/zope-dev )
>