[Zope] m_self of methods accessed via non trivial acquisition

Max M maxm@mxm.dk
Thu, 17 Jan 2002 12:55:26 +0100


Stefan Bund wrote:


I hope someone can shed light on this subject,


I have a rule of thumb for getting a nag on aquisition that hasn't
failed me yet.

I see every objectmanager as a directory in an ordinary filesystem.

Normally in a filesystem if it has the following layout::

a/      # directory
     m1   # file (attribute)
     b/
       m2
       c/
          m3
     d/
        m4
        e/
           m5
           f/
              m6

then if I am in 'f' and I want to get to attribute m2 in 'b' i will write:

1) ../../../b/m2

if I want to get to attribute m3 in 'c' I will write:

2) ../../../b/c/m3

Attribute m4 in 'd' will be:

3) ../../m4

My concept of aquisition is a method that automagically appends the
correct numbers of '../' untils it finds the first first occurence of
the first directory for me :-)

so if I want to do the three examples above via aquisition I would just
write:

1) b/m2 or b.m2 (in dot notation)

2) b/c/m3 or b.c.m3

3) m4

Hope that helps.

regards Max M