[Zope] Acquisition problem
Chris Withers
chrisw@nipltd.com
Fri, 28 Apr 2000 17:28:07 +0100
> Yeah, acquisition is a little tricky until you're used to it. Remember
> that it doesn't *just* traverse your URL. Let's say you've got the
> following:
>
> /
> /FolderA
> /FolderB
>
> The root folder and FolderA both have a property (with the same name). If
> you reference the property in "/" or "/FolderB", you'll get the root-level
> property as you'd expect, and if you reference it as "/FolderA", you'll get
> the one from FolderA. However, if you reference it from "/FolderA/FolderB",
> you'll get the root-level property, which I'm guessing is happening to you.
>
> How exactly are you getting at the property? What's your directory structure
> look like?
Right, we have:
Root = ErrorsToProperty
|
+ - standard_error_message
|
+ - method2
|
+ - Folder = ErrorsToProperty
|
+ - method
|
+ - method1
Now if method generates an error, I guess standard_error_message gets called in
the context of the root object, and so the root's ErrorsToProperty gets used.
Hmmm, which raises two interesting questions, which might be the same, but
probably aren't:
1. How can I make standard_error_message (in root) use the correct
ErrorsToProperty?
2. In general, how can I make method2, called(and acquired) by method1, use
a
property of method1's container in preference to the same property of
method2's container?
(see the diagram above if your head hurts as much as mine does ;-)
cheers,
Chris