>At 23:38 2002-08-14 -0400, Casey Duncan said:
>>The Item class mixes in Traversable, which is probably responsible for 
>>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 
>>mixes this and Persistence in for you (along with Item), so many Zope 
>>derive form SimpleItem. You need Persistence to store instances of your 
>>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.

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'):
             return item.__of__(self)  <--- wrap the item before returned

Johan Carlsson

Torped Strategi och Kommunikation AB
Johan Carlsson

Birkagatan 9
SE-113 36  Stockholm

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

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

Reply via email to