[Zope] Problems with acquisition in PythonScript objects

Jérôme Loisel jerome@levinux.org
Mon, 5 Mar 2001 13:23:33 -0500


Hi!

I am having getting objects through acquisition in PythonScript objects. I do 
not know if I am doing it wrong or if this is a bug...

I have object foo (an image) in my root folder. I have bar, a PythonScript 
which calls foo's absolute_url() method. bar works as expected when viewing 
it from the root folder, but never from subfolders. I get attribute errors: 
foo does not exist.

I have tried the following ways of calling foo's absolute_url():
context['foo'].absolute_url()
_['foo'].absolute_url()
_.getitem('foo').absolute_url()

Yes, I have bound _ to the namespace. In all cases, I get attribute errors 
saying that foo does not exist. It seems to me that acquisition from within 
PythonScripts is not working... Any thoughts?

BTW, I have also tried the following, which obviously does not work:
context.getitem('foo').absolute_url()

Thanks in advance!

Jérôme Loisel


-- 
Jérôme Loisel
Lévinux: GNU/Linux dans les communautés à Lévis