[Zope] calling methods

Antonio Beamud Montero antonio.beamud@agoratechnologies.com
18 Oct 2001 10:59:42 +0200


On Wed, 2001-10-17 at 20:58, Casey Duncan wrote:
> On Wednesday 17 October 2001 12:48 pm, Antonio Beamud Montero allegedly wrote:
> > Hello all again:
> > I have a Folder named A:
> > A contains an object obja with 2 methods (methoda, methodb).
> > A contains a Folder named B also.
> > In B exist an object named objb, and in this object I want to use the
> > methoda from the object sited in his parent folder...
> >
> > How I can do this?
> 
> objb should have direct access to methoda through acquisition. See:
> 
> http://www.zope.org/Members/michel/ZB/AdvDTML.dtml
> http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html#c37ac15c13
> 

Ok, but I don't want this. I want to do the next:
A is Folder with a lot of object instances.
from one of this instances I want to had a variable of references to
objects in the same folder, but I don't know how to do this.

Something like this:

Class A(Folder):
...

Class x(Implicit, Persistent, PropertyManager, RoleManager, Item):
	....
	__init__(self, id, title):
	self.myfriends = []
	def list_Posible_Friends(self):
	  """ Here I want to know what objects has instantiated my container"""
	
          posible_list = self.objectValues()

#######################
This action doesn't works like I want to works...
#######################

	 def addFriend(self, Ref):
	    list.append(Ref)

How I can do this