Terse Syntax through External Methods

Bruno Desthuilliers bruno.42.desthuilliers at wtf.websiteburo.oops.com
Tue Jan 29 16:35:52 CET 2008

Jens a écrit :
> On Jan 25, 3:19 pm, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
>> Jens schrieb:
>>> Hello Everyone
>>> I'm newbie to Zope and i have a few questions regarding external
>>> methods. 
>>> This doesn't work because because the method doesn't have access to
>>> the environment.

>> If it has to be an External method, you can't access such a context

IIRC, that's what the 'self' argument is for. Now I don't know if it 
will solve the OP's problem with dtml (which I avoid like pest).

>> But then you can create a python script that _has_ this context,
>> and passese it to the external method. Not the nicest solution, but
>> should work.
> Like I said i'm a newbie. I though the deal with Zope was that i
> couldn't really do inline scripting (for security reasons)
> like in php but had to use these external methods. how does one go
> about creating a "normal" python script exactly and
> how do I invoke it's functionality?

Zope (well... Zope2.x) has an object type named "Script (Python)". What 
you can do with them is restricted (for security reasons) but is 
obviously enough for what you want here. And really, you should *not* 
use dtml unless you have no other choice at all.

Anyway: Zope is a world in itself, and most pythoneers don't use it. The 
Zope experts are mostly on the Zope's mailing list, so that's where you 
should post such questions.


More information about the Python-list mailing list