[Zope] Problem: Calling DTML Method from ZPT
Steve Spicklemire
steve@spvi.com
Fri, 03 Aug 2001 20:27:41 -0500
Hi Mike,
Something in your standard_html_header having to do with a guestbook is
raising an exception. You've left out the actual error type from the
error page, so it's sorta hard to tell from there. I see a couple of
problems.. apparantly your index_html wants to display a whole page...
this will be bogus in a <p /> tag. Also.. it's hard to tell what
contextual information your index_html is going to need.. you man need
to pass in additional arguments. Can you share a bit about index_html?
In any case, you might replace it with some simpler stuff to make sure
it's getting called correctly.
'nuther layer in the dang onion ;->,
-steve
Mike Murphy wrote:
>
> 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 )
> >