calling DTML method from python script in Zope
of course I looked over at ZopeLabs; http://www.zopelabs.com/cookbook/992031125 and while this shed some light on the situtation, it hardly solved the problem. the script calls a DTML method in the same folder from which it resides & was called from -thanks in advance -josh
On Sun, 2003-11-23 at 22:59, scripts-urban@imeme.net wrote:
of course I looked over at ZopeLabs;
http://www.zopelabs.com/cookbook/992031125
and while this shed some light on the situtation, it hardly solved the problem.
the script calls a DTML method in the same folder from which it resides & was called from
When calling a DTML method from Python, you need to pass in the arguments it expects: def __call__(self, client=None, REQUEST={}, RESPONSE=None, **kw): While the declaration makes the arguments optional, the template won't be able to bind names unless you pass them. In your case, I would try: dtml = container.your_template_name_here req = context.REQUEST return dtml( container, req, req['RESPONSE'] ) Tres. -- =============================================================== Tres Seaver tseaver@zope.com Zope Corporation "Zope Dealers" http://www.zope.com
Hm, I would hope that the Zope book answers this kind of questions, see: http://zope.org/Documentation/Books/ZopeBook/2_6Edition/ScriptingZope.stx search for "Calling DTML from Scripts" This should solve your problem -- please leave a comment if it doesn't. Thanks, peter. scripts-urban@imeme.net wrote:
of course I looked over at ZopeLabs;
http://www.zopelabs.com/cookbook/992031125
and while this shed some light on the situtation, it hardly solved the problem.
the script calls a DTML method in the same folder from which it resides & was called from
-thanks in advance
-josh
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
participants (3)
-
Peter Sabaini -
scripts-urban@imeme.net -
Tres Seaver