[Zope] newbie questions about packages, external methods and persistence

Robin Becker robin@jessikat.demon.co.uk
Tue, 2 Nov 1999 10:50:37 +0000


In article <00ed01bf24de$b1e94e20$b8b06682@wattle.dstc.edu.au>, Gregor
McEwan <mcewan@dstc.edu.au> writes
>Hi,
>
>I have 3 questions that are (hopefully) easy for someone with Zope
>experience.
>
>1)  What's the best way to access a python package from Zope?
>My current state of knowledge would suggest that an external method or set
>of external methods would be the best way.  However, does that mean that for
>each external method that accesses one of the methods in my class, I have to
>create a new instance of the class?  Is there some way to keep a reference
>to a class as a Zope object so that I can use it in different DTML documents
>in the same folder?
>


be aware that external functions cannot have globals eg a classic
approach to a counter would be

value=0
def counter():
    value=value+1
    return value

this will not work as an external method
-- 
Robin Becker