Hi there,

I want to have a method which returns a list of all properties of an object.

The problem: when I write a Method (DTML or Python) I always get the
properties of the container of the method, but not the ones of the object I
applied the method. I used propertyMap, propertyIds and propertyItems.

Say xxx is an instance of a ZClass and resides in the root directory.
will return a map of all properties of the root folder not of the xxx

Say you define a method yyy which access concrete properties of the object
with dtml-var, say ''who" and "when", then it will access these properties
if they exist and fail if one of these doesn't.

Ok. I found it, I have to access each propertysheet, but if I try something

<dtml-in "propertysheets">
<dtml-var propertyMap>

the login window with username/password is presented, but whatever I type I
get an authorization error, so I think there is a private properysheet,
isn't it?

So how can I get a list of all properties defined in an object?

I'll answer the question myself, but I think it is a bit complex. The
philosophy is to write nearly everything in Python????

External (unrestricted) Pyhton script (like id=getprops, module=getprops,
function=getprops) :
def getprops(self):
    for y in self.propertysheets:
        for z in y.propertyItems():
    return x

Now a DTML method for displaying this (e.g. as printproperties):
<dtml-var standard_html_header>
<h2>Properties of <dtml-var title_or_id></h2>
<dtml-in getprops>
<li><dtml-var sequence-key>: <dtml-var sequence-item>


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

Reply via email to