[Zope] Acquisition not working as expected

Roman Klesel roman_plonemail at lotuseyes.de
Fri Mar 3 02:20:29 EST 2006


Dieter Maurer schrieb:
> Roman Klesel wrote at 2006-3-2 08:13 +0100:
> 
> This is how acquistion works (and should work):
> 
>   When you acquire a method, the "self" this method is called
>   with is usually *NOT* the object acquisition is applied on.
> 
> If you think about it, you will recognize that this must be the case:
> 
>   For any method "m" of class "C", its first argument *MUST* be
>   a "C" instance.
> 
>   If you acquire the method "m" starting from "o", then
>   "o" may have a completely different class then "m".
>

OK

> 
> In your case, the method "test3" is not defined by "Folder"
> but by what you call "your product instance" (still a wrong term!).
> Therefore, its "self" is necessarily an instance of "your product"
> (I keep your wrong term). And "self.getId()" gives (consequently)
> its (and not the Folder's) id.
> 

What would then be the right term? (I suspect I'll have to discuss this further)

> 
> You cannot do with acquisition what you want to do...
> 

I hope I will. However I might have to do it in a different way.

Thanks, this helped me to be more clear about acquisition.

Roman


More information about the Zope mailing list