On Mon, Apr 04, 2005 at 12:49:30AM +0200, [EMAIL PROTECTED] wrote:
> The code i've writed imports date object from datetime
> package: this makes it
> doesn't work like a script (python), so i adapt code
> as an external method;

Maybe you could use Zope's own DateTime, which can be
used in Scripts?

> Well, 2 are the questions:
> First, what i've to do to get service variable like
> like container, context, request, etc.. ?
> Which are differences between script and external
> method coding? i remember that the zope book
> indicates only imports.

It's maybe not obvious, but implicit in the book is that the bindings
described for Scripts (container, context, etc.) apply only to Scripts,
and not for External Methods.

With External Methods, if the first argument to the function is
named "self", you can treat "self" as being equivalent to a python 
script's "context".

The request can be acquired as self.REQUEST.

The container of the external method... don't know. I never yet
had a case for an external method where I cared about the difference 
between context and container.


Paul Winkler
Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to