[Zope] (no subject)

jkinsley jkinsley@bticc.net
Thu, 28 Feb 2002 10:44:26 -0500 (EST)


How can I add a subobject to a container where the subobject id 
is the same as a container property so that the subobject will be 
used instead of the the container property?  Is this a good idea, 
and/or is there a better way?


class Container(...ObjectManager, PropertyManager...)
	"""A Folderish Object Product
	"""

	...

	_properties = (
			{'id:'title', 'type':'string', 'mode':'w'},
			{'id:'default', 'type':'string', 'mode':'w'},
		)

	...

	__init__(self, id, title='', default=''):
		self.id=id
		self.title=title
		self.default=default

	...

Now in Zope I add a 'Container' object with id ZContainer and set 
ZContainer.default = 'The default value.'  In most instances this 
is sufficient, but on occassion is is necessary to get the value of 
content from a more complex object such as a Document.  In such a 
case I would like to be able to simply add a Document object to 
ZContainer with 'default' as its id so that when ZContainer.default 
is called, the contents of the Document are returned instead of the 
value of the default property.  If this is not a good idea, what are 
the alternatives?


Regards,
Jarrod Kinsley
BTI Communications Company