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

2007-02-28 Thread Alek Kowalczyk
Tom Dossis [EMAIL PROTECTED] 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

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

2007-02-28 Thread FB
Hi, On Wed, Feb 28, 2007 at 12:57:35PM +, Alek Kowalczyk wrote: Tom Dossis [EMAIL PROTECTED] 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

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

2007-02-28 Thread Alek Kowalczyk
FB [EMAIL PROTECTED] writes: 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

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

2007-02-28 Thread Philipp von Weitershausen
Alek Kowalczyk wrote: FB [EMAIL PROTECTED] writes: 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

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

2007-02-28 Thread Alek Kowalczyk
Philipp von Weitershausen [EMAIL PROTECTED] writes: I don't think I would like to redesign my objects just because the addIntIdSubscriber does not catch NotYet when getting IKeyReference: at adapter(ILocation, IObjectAddedEvent) def addIntIdSubscriber(ob, event): # ...

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

2007-02-26 Thread Tom Dossis
Yes, this is what I'd recommend. A handler for an ObjectAddedEvent will always see the object already as part of the object hierarchy (which is, after all, what ObjectAddedEvent is about). I found myself doing this quite often. I use a decorator to make the code read nicer.. class

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

2007-02-25 Thread Jürgen Kartnaller
Christophe Combelles wrote: Hello, I've been spending several hours on a problem which is probably trivial for advanced zope3ers, but it was not for me, so I'm posting the solution in case it's useful for someone (I've not found anything on it).

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

2007-02-25 Thread Christophe Combelles
Jürgen Kartnaller a écrit : Christophe Combelles wrote: Hello, I've been spending several hours on a problem which is probably trivial for advanced zope3ers, but it was not for me, so I'm posting the solution in case it's useful for someone (I've not found anything on it).

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

2007-02-25 Thread Philipp von Weitershausen
Jürgen Kartnaller wrote: I've also tried to create the subfolders in a subscriber on IObjectCreatedEvent, but this is equivalent to the previous attempt : NotYet error. What I've understood is that the transaction that manages the folder is not finished, and the IntId utility is not yet able