[Zope] iterating through object properties?

Chris McDonough chris@iqgroup.com
Fri, 24 Sep 1999 23:06:17 -0400


I have tried code like the following:

  <!--#in "myzclassinstance.propertysheets.Basic"-->
     <!--#var "id"-->=<!--#var "value"-->
  <!--#/in-->

... and get a traceback like this:

Error Type: AttributeError
Error Value: __getitem__

<snip>

Traceback (innermost last):
  File /usr/local/Zope-2.0.0/lib/python/ZPublisher/Publish.py, line 214, in
publish_module
  File /usr/local/Zope-2.0.0/lib/python/ZPublisher/Publish.py, line 179, in
publish
  File /usr/local/Zope-2.0.0/lib/python/Zope/__init__.py, line 201, in
zpublisher_exception_hook
    (Object: ElementWithAttributes)
  File /usr/local/Zope-2.0.0/lib/python/ZPublisher/Publish.py, line 165, in
publish
  File /usr/local/Zope-2.0.0/lib/python/ZPublisher/mapply.py, line 160, in
mapply
    (Object: testprops)
  File /usr/local/Zope-2.0.0/lib/python/ZPublisher/Publish.py, line 102, in
call_object
    (Object: testprops)
  File /usr/local/Zope-2.0.0/lib/python/OFS/DTMLMethod.py, line 145, in
__call__
    (Object: testprops)
  File /downloads/Zope-2.0.0-src/lib/python/DocumentTemplate/DT_String.py,
line 502, in __call__
    (Object: testprops)
  File /downloads/Zope-2.0.0-src/lib/python/DocumentTemplate/DT_In.py, line
672, in renderwob
    (Object: myzclassinstance.propertysheets.Basic)
AttributeError: (see above)

Is something like this possible?  What I'd like to do is iterate through the
properties of a zclass instance..