>At 23:38 2002-08-14 -0400, Casey Duncan said:
>>The Item class mixes in Traversable, which is probably responsible for 
>>making
>>this work TTW. It also gives you a bunch of other stuff that many Zope
>>classes need, like DAV support, copy support, ZMI tab support and security.
>>It doen't mix-in acquisition tho.
>>
>>If you need support for acquistion machinery (including __of__ which creates
>>wrappers), then you need to mix-in Acquisition.Implicit. The SimpleItem 
>>class
>>mixes this and Persistence in for you (along with Item), so many Zope 
>>classes
>>derive form SimpleItem. You need Persistence to store instances of your 
>>class
>>in the ZODB, and implicit acquisition is the standard for Zope objects.
>>
>>In short I would recommend mixing in SimpleItem or you may find that your
>>objects are not stored properly in the ZODB.
>>
>>-Casey


You also might want to wrap the object before returning them,
because the are stored in _item and not in the AixtraTableProduct.

     def getItem(self,key): #{{{
         "returns item"
         data = self._items
         if data.has_key(key):
             item = self._items[key]
             if not hasattr(item,'key'):
                 setattr(item,'key',key)
             return item.__of__(self)  <--- wrap the item before returned

Regards,
Johan Carlsson




-- 
Torped Strategi och Kommunikation AB
Johan Carlsson
[EMAIL PROTECTED]

Mail:
Birkagatan 9
SE-113 36  Stockholm
Sweden

Visit:
Västmannagatan 67, Stockholm, Sweden

Phone +46-(0)8-32 31 23
Fax +46-(0)8-32 31 83
Mobil +46-(0)70-558 25 24
http://www.torped.se
http://www.easypublisher.com


_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to