[Zope] simple and quick question

Casey Duncan cduncan@kaivo.com
Thu, 28 Jun 2001 08:27:15 -0600


Peter Bengtsson wrote:
> 
> How do I loop over an objects properties? I don't know the names of any of
> the properties.
> 
> <pseudo>
> for property, propertyvalue in context.object.itsProperties().items():
> </pseudo>
> 

<dtml-in name="propertyMap" mapping>
	Name: <dtml-var name="id">
	Type: <dtml-var name="type">
	Value: <dtml-var expr="getProperty(id)">
</dtml-in>

or

for prop in obj.propertyMap():
	print prop['id']
	print prop['type']
	print obj.getProperty(prop['id'])

hth,
-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>