[Zope] acquisition vs. inheritance
Jonothan Farr
jfarr@real.com
Fri, 4 Aug 2000 10:56:19 -0700
Dang! Just when I think I understand this acquisition thing. ;)
Sorry for the misinformation.
--jfarr
"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998
----- Original Message -----
From: Chris Withers <chrisw@nipltd.com>
To: Jonothan Farr <jfarr@real.com>
Cc: Bob Horvath <bob@horvath.com>; <zope@zope.org>
Sent: Friday, August 04, 2000 1:54 AM
Subject: Re: [Zope] acquisition vs. inheritance
> Jonothan Farr wrote:
> >
> > > Is it possible to have just one top level object that refers to
> > > other objects that get overridden as you go into other folders?
> >
> > Acquisition works the other way around. You can create objects in subfolders
> > whose contents are overriden higher up. You can't have an object at the top
> > whose contents get overridden as you go down.
>
> Urm, I think wires are getting crossed here, so here's an example which
> may help (and which we use on most of our sites):
>
> index_html is a DTML method:
>
> <dtml-var standard_html_header>
> <dtml-var index.html>
> <dtml-var standard_html_footer>
>
> Now, in each folder we have DTML documents called index.html which
> actually contain the pages.
>
> So, we have one index_html and many index.html's.
>
> When someone does http://www.mysite.com/folder/
> This actually renders http://www.mysite.com/folder/index_html
> Then, index_html is acquired from the root.
> However, because index.html exists is /folder, it is that which is
> displayed.
>
> I hope this makes it a little clearer :S
>
> cheers,
>
> Chris
>
> PS:
> > Your solution was correct. Create another index_html in the subfolder,
>
> As long as index_html is a method, you only need one of them, in the
> root.
>
> > which
> > uses the 'contents' object in the subfolder,
>
> This will still happen if there's only one index_html
>