Ok, knowing more about what's going on, now, I figured I would send an
update to the list and hope it jars someone's memory.

Here's what I am trying to do:

I have a ZClass, MyTestClass. MyTestClass has two methods: method1, and
method2. There are two other methods, showMethods and showMethods2, but
they are only needed for the purpose of demonstration.

I created an instance of MyTestClass with an id of 'test'.

showMethods (a DTMLMethod) is defined as:

  <dtml-var standard_html_header>
  method1 = <dtml-var "_.hasattr(this(), 'method1')"><br>
  method2 = <dtml-var "_.hasattr(this(), 'method2')"><br>
  nullmethod = <dtml-var "_.hasattr(this(), 'nullmethod')">

  <dtml-var standard_html_footer>

and, when invoked on my 'test' instance, returns:

  method1 = 1
  method2 = 1
  nullmethod = 0

We're cookin'. Now, I need to get the same results with a PythonMethod.
showMethods2 (a PythonMethod) is defined as:

  print _.hasattr(self, 'method1')
  print _.hasattr(self, 'method2')
  print _.hasattr(self, 'nullmethod')
  return printed

which, when invoked on my 'test' instance, returns:


I have tried every permutation of Python code I can, and none work as the
DTML Method does. Somebody? Anybody? :-)


Jeff K. Hoffman                               704.849.0731 x108
Chief Technology Officer                      mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C.                         http://www.goingv.com/

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to