[Zope] Getting an objects properties

Leon de Heus hapkido@kabelfoon.nl
Wed, 06 Oct 1999 21:53:32 +0000


I guess I forgot to quote the previous message in my last reply wich made it
a little unclear. Sorry for that. But here's what I've got so far:

I'm trying to write an external method that will export objects to the file
system as folders with the properties stored as files. This way I can check
them into CVS as regular files and folders.

I use a 'package' property for my objects to specify the CVS module an
object belongs to. The method also exports and stores the subobjects, unless
it has it's own 'package' property. This way I don't have to export an
entire object tree.

I've been using Zope for 3 weeks now and I'm new to python. So far I have
found / heard 3 ways to access all of an objects properties:

1) I noticed pythons dir() function. That's what I'm using right now and the
procedure seems to work.
But I don't know if that will get all the objects properties correctly.

2) The 2nd way would be to use the propertyIds, propertyItems, etc. methods.
But the current ZClasses I created didn't inherit those, so that would mean
I would have to design my ZClasses differently.

3) Or I could access the properties through the propertysheets as you
mentioned.

I don't know wich would be the most correct way (wich wouldn't miss any
properties).


Best,
Leon.



Kevin Dangoor wrote:

> Just a guess... These methods are probably actually methods of the
> propertysheet not the ZClass... If your propertysheet is called
> "properties", you may need to do:
>
> <dtml-in "propertysheets.properties.propertyIds()">
> </dtml-in>