Re: [Zope-dev] Acquisition Confusion :S

2000-08-14 Thread Chris Withers
Steve Alexander wrote: That makes for a lot of security checks. There are possible optimisations, though. But this starts to get even more complicated. Does that mean it won't work, would be very slow, or both? ;-) cheers for looking though... Chris

Re: [Zope-dev] Acquisition Confusion :S

2000-08-14 Thread Chris Withers
Michel Pelletier wrote: A.B.C.D Look for D in C, if it's not there, look in B if it's not there, look in A Someone correct me if I'm wrong here, but... This is a linear search, which is the way acquisition *used* to work. Which Zope version? ;-) Consider: A / B/ C/

Re: [Zope-dev] Acquisition Confusion :S

2000-08-14 Thread Steve Alexander
Chris Withers wrote: Steve Alexander wrote: That makes for a lot of security checks. There are possible optimisations, though. But this starts to get even more complicated. Does that mean it won't work, would be very slow, or both? ;-) It will work. It will be slower. I think Evan

Re: [Zope-dev] Acquisition Confusion :S

2000-08-14 Thread Chris Withers
Evan Simpson wrote: I haven't got the whole reason, but here are some of the pieces: - never expose a "bare" object, or even one with an incomplete context Why? You can get at it through aq_base anyway, surely? Also, Jim Fulton wrote a while back: Sure. There is no guarentee that all

Re: [Zope-dev] Acquisition Confusion :S

2000-08-14 Thread Evan Simpson
From: Chris Withers [EMAIL PROTECTED] - never expose a "bare" object, or even one with an incomplete context Why? You can get at it through aq_base anyway, surely? Only from unrestricted code. DTML and (CVS) Python Methods only let you access aq_parent. This only applies to objects that

Re: [Zope-dev] Acquisition Confusion :S

2000-08-08 Thread Steve Alexander
Michel Pelletier has reminded me that we need a security check by containment at each point in the search through context. So, in my example, the search will look like this: / |-Aa | |-B b | |-Xx | |-P p1 | |-Y y | |-Pp0 Context-first Acquisition (P

Re: [Zope-dev] Acquisition Confusion :S

2000-08-07 Thread Chris Withers
Evan Simpson wrote: So, is the working below now correct? (I feel like I'm back in School doing maths ;-) Yes. Cool :-) Where is the order of simplification defined? In the Acquisition machinery, which simplifies upwards because that's the way it constructs the wrappers. okay...

Re: [Zope-dev] Acquisition Confusion :S

2000-08-07 Thread Steve Alexander
Chris Withers wrote: Steve Alexander said he was going to have a think, but I haven't heard anything since he mentioned it... I'll have to start running a Kibo-bot soon :-) I've got as far as defining the difference between the two acquisition behaviours. Warning: The following goes into

Re: [Zope-dev] Acquisition Confusion :S

2000-08-02 Thread Chris Withers
Evan Simpson wrote: Here are the two and a half rules for deriving acquisition from a dotted expression: 1. A.B == (B o A), where A is an unwrapped object 2. (self o parent).B == a. (self.B o (self o parent)), if B is found in 'self' b. (parent.B o (self o parent)), if B is

[Zope-dev] Acquisition Confusion :S

2000-07-31 Thread Chris Withers
Hi Jim, (or any zope-dev'ers who can explain this ;-) I've just been reading: http://www.zope.org/Members/jim/Info/IPC8/AcquisitionAlgebra ...and I've got confused on the 'Getting the containment wrapper' section. In anser to 'What is A.B.C.D?' I can't see how you can get: ((D o (C o A)) o (B

Re: [Zope-dev] Acquisition Confusion :S

2000-07-31 Thread Chris Withers
I still don't get this :( Here's the situation: A has attributes B and C, C has attribute D my old working: A.B.C.D = (B o A) : .C.D now, since C is found in A: = ((C o A) o (B o A)) : .D again since D is found in C: = ((D o C) o ((C o A) o (B o