[Zope] Security?

Peter Sabaini peter at sabaini.at
Mon Dec 1 12:12:42 EST 2003


Goldthwaite, Joe wrote:

[snip]

> I tried making my module an external method but it also choked on the import
> mx.ODBC line.  As a side question, the external method asks for a routine
> and function name.  I'm trying to execute a class.  It has functions in it
> but it's not a single function.  Are external modules ONLY for specific
> functions?  Do they work with Python classes at all?

Of course. You just have to wrap your classes up in a function.
Arbitrary sample -- say we've got a python file 'HelloModule.py' containing:

class HelloSayer:
     def greet(self): return 'hello'
def wrapper(self):
     h = HelloSayer()
     return h.greet()


In this example, your External Method would probably be called 'greet' 
(arbitrary, really), the function name should be 'wrapper', and the 
module name should be eg. 'HelloModule'

hth,
peter.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3461 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.zope.org/pipermail/zope/attachments/20031201/6fd2b8c0/smime.bin


More information about the Zope mailing list