[Zope] External method and import

Daryl Tester dt@picknowl.com.au
Mon, 08 May 2000 11:49:03 +0930


mikl@club-internet.fr wrote:

> But, Zope does seem to like import in the external method.

I presume you meant "does not" here.  Yes, this is true.

> 2- What am I missing in Zope external method use ? Is there particular
> restriction on import (no pun intended !) ?

I'm presuming that you are doing a module level import.  Although I
haven't attempted this yet, in Python you can move the import inside
the function that you're calling.  For example:

def test_function(self):
    from foo import bar
    bar(self, 'ram', 'ewe')

One day, I will get around to testing this myself (for that is the
nature of my surname :-) ...


Regards,
  Daryl Tester