[Zope3-Users] Re: NotYet error when creating content during container creation

FB fbo2 at gmx.net
Wed Feb 28 08:22:30 EST 2007


Hi,

On Wed, Feb 28, 2007 at 12:57:35PM +0000, Alek Kowalczyk wrote:
> Tom Dossis <td at ...> writes:
> 
> I have another issue with IntIds and NotYet:
> I have some BTreeContainer-derieved object which is short-living container. 
> It is never stored in ZoDB 
> - it is just a result of some query to external system.
> 
> It worked fine until I enabled IntIds utility.
> Now I get NotYet when adding anything to my container - 
> because IntIds tries to attach Id to it anyway. 

It tries that, because it's handler is called by the container's __setitem__
method. Just write your own - like that:

class MyContainer(BTreeContainer):
   def __setitem__(self,key,object)
      object.__parent__=self
      object.__name__=key
      self.__data[key]=object

   def __delitem__(self,key):
      del self.__data[key]

(Not testet!)

However, you might not need a BTreeContainer but just a simple
BTrees.OOBTree.OOBtree which behaves like a dict but is a btree.

Regards,

Frank



More information about the Zope3-users mailing list