[Zope3-dev] Getting the parent object

Chris Withers chrisw@nipltd.com
Sat, 30 Mar 2002 16:46:29 +0000


Stephan Richter wrote:
> 
> Unless there is a way to get back to the parent otherwise, I propose that
> we set a __parent__ attribute in an object, when it is added to the
> container. Therefore, all containers are required to implement that feature.

Circular references.... yum ;-)

Well, I don't have a problem with a child needing to know it's parent. Whether
or not this should be stroed in yet another __something__ variable on the child
is another matter...

How about a much more generic Relationship service which could store this
information?
Seems that would be much more Zope 3 like in that it doesn't impose restrictions
on the classes implementing thre __parent__ thing. It also makes relationships
much mroe dynamic and allows easily things like multiple parents and children...

how does that sound?

cheers,

Chris

PS: Could the ObjectHub be extended to cover this or is it mroe appropriate to
get a new service completely?