[Zope] Indirect method lookup?
Jeff Hoffman
jeff.hoffman@goingv.com
Mon, 21 Aug 2000 13:04:08 -0400 (EDT)
Hello,
I am trying to build a simple framework that is going to use "events" to
callback into higher level logic. Specifically, I am creating a "Text
Field" that represents an HTML form field. Its validate() method needs to
call whatever method is specified in its validateHandler property (which
is a string).
My validate() method is a PythonMethod. Before I can call the event
handler, I need to get ahold of the method object. I have tried all of
the following and gotten nothing but KeyErrors/AttributeErrors:
_.getitem(self.validationHandler)
_[self.validationHandler]
self[self.validationHandler]
self.getitem(self.validationHandler)
getattr(self, self.validationHandler)
etc.
It is important to note that the method I am looking for, the one named by
the string property, is not defined in the field class itself. I need to
rely on acquisition to find it; it is defined in one of the containers of
the field object.
I know this has to be simple; I must be missing something.
Anyone care to share some clue?
--Jeff
---
Jeff K. Hoffman 704.849.0731 x108
Chief Technology Officer mailto:jeff.hoffman@goingv.com
Going Virtual, L.L.C. http://www.goingv.com/