[Zope-dev] Re: Refresh trashes acquisition

Ross Boylan RossBoylan@stanfordalumni.org
Thu, 25 Jul 2002 18:54:26 -0700


On Fri, Jul 26, 2002 at 01:47:12AM +0200, Lennart Regebro wrote:
> From: "Ross Boylan" <RossBoylan@stanfordalumni.org>
[snip]
> 
> > This style of containment and optional overriding seemed to me exactly
> > what acquisition was all about, so I tried to do it with acquisition.
> > But it didn't work.
> 
> I haven't really understood what didn't work, because I have been on
> vacation and not following this thread very closely...
> 

Previously in this thread I was advised that acquisition relationships
don't persist across transaction boundaries, and this was consistent
with the failures I was getting when trying to use it (actually, the
relations only got zapped when I did a product refresh, but that was
enough to make them unusable, particularly with the word I couldn't
count on them in general).

> > Based on previous responses, I've implemented a containment hierarchy
> > by hand.
> 
> "By hand"? You mean that instead of having your objects being Zope objects
> added from the Add drop down box, they are pure python objects and added
> only by code?
> 
> 
> 

Not that much by hand; in fact they are mostly subclasses of SubItem
or ObjectManager.  The by hand part is that I have an explicit
_container variable that I set in my classes, and various methods that
support using it.  So when I want something that might be in a
container, I use those methods to get it rather than relying on
acquisition.