Thank you everybody for your input and help with this.
What was explained to me and what I missed when reading about acquisition is that _getattr_ is used by acquisition to return attributes in context. If your objects are in a list, _getattr_ is not available, but _getitem_ is used to return the objects. So there are two solutions and two schools of thought on how to solve this. Some will over ride _getitem_ so that lists return object.__of__(self) , others will wrap the objects manually.


The second solution is the one that I took.
I wrote a method for my class that takes an integer and will return that element from the list as a wrapped object.

simply

def getObject(self,i):
  '''return wrapped object from list'''
  object = self.list.__of__(self)
  return object


Thanks again everyone for your help.

-Kevin

_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to