Re: [Zope-dev] calling DTML method from python script in Zope

2003-11-24 Thread Tres Seaver
On Sun, 2003-11-23 at 22:59, [EMAIL PROTECTED] 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[EMAIL PROTECTED]
Zope Corporation  Zope Dealers   http://www.zope.com


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


Re: [Zope-dev] calling DTML method from python script in Zope

2003-11-24 Thread Peter Sabaini
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.
[EMAIL PROTECTED] 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  -  [EMAIL PROTECTED]
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 )


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )


[Zope-dev] calling DTML method from python script in Zope

2003-11-23 Thread scripts-urban
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  -  [EMAIL PROTECTED]
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 )