[Zope] Calling an python method from within a python method
Evan Simpson
evan@4-am.com
Wed, 13 Oct 1999 22:03:38 +0000
Dan Rusch wrote:
> Does anyone know if it is possible to call an internal python method
> (built with the Python Method object) from within an internal python
> method (also built with the Python Method object)?
Well, sure! What I guess you're really asking is how to access the other
method. You do that the same way as you would any other Zope object.
> For example:
>
> I have an internal python method called convertDate built with the
> Python Method object. Inside this method I would like to call another
> internal python method called isLeapYear(). Can this be done, if so how?
At the moment, you would need to pass a namespace such as '_' into
convertDate, and call LeapYear as "_.LeapYear()". Once I get a round Tuit,
I'm planning on allowing you to 'import LeapYear' or 'from otherFolder
import LeapYear' and avoid passing the namespace in.