[Zope] one external method calling another; what possibilities?
Fred Yankowski
fred@ontosys.com
Fri, 6 Oct 2000 16:42:42 -0500
I'm using some example code that defines an External Method to process
a form. That External Method calls another utility function to log
some data. I'm not quite sure what choices I have for creating that
utility function, so I created another External Method for it. Both
functions are in the same Python source file in the Extensions folder.
Anyway, the main external function calls the utility function like this:
self.function2(arg1=valuex, arg2=valuey)
I expected that function2 would have to be defined like this:
def function2(self, **kwargs)
but it turned out that that fails at runtime with a complaint about a
mismatch between the number of arguments sent and expected (0 and 1,
respectively). The following does work:
def function2(**kwargs)
So, why isn't function2 called as a method function?
Was there some better way I could have implemented function2, rather
than as an external method?
Where is reference documentation on External Methods? I couldn't find
anything other than a very cursory overview in one of the PDF'ed
documents (I forget which).
--
Fred Yankowski fred@OntoSys.com tel: +1.630.879.1312
Principal Consultant www.OntoSys.com fax: +1.630.879.1370
OntoSys, Inc 38W242 Deerpath Rd, Batavia, IL 60510, USA