[Zope3-Users] object id / name / name within parent?

Amos Latteier amos at latteier.com
Fri Jan 7 17:27:15 EST 2005

Petri Savolainen wrote:

> I understand that objects have names, stored in the __name__ attribute 
> of an object, and that this 'name' is what containers know contained 
> objects by.


> To what extent is this analogous to a Zope2 id? Or do Z3 
> objects have an id, in addition to name?

It's fairly similar to Zope2 ids. There is no standard id in addition 
the the name.

> How does one create/access/manipulate object ids/names programmatically? 
> What interfaces would you recommend taking a look at, in addition to 
> IContained and INameChooser?

IReadContainer and IWriteConteiner will tell you about containers. 
ILocation is also relevant.

Basically containers work like standard python dictionaries. The 
__parent__ attribute is a link to the parent. Zope 2 used acquisition 
for this.

Also you should know that if objects don't support ILocation then they 
will be wrapped in a containment proxy by their container.

Check out the programmer tutorial for more information.


Good luck!


More information about the Zope3-users mailing list