Re: [Zope] Problems with acquisition in PythonScript objects
6 Mar
2001
6 Mar
'01
8 p.m.
=?iso-8859-1?q?J=E9r=F4me=20Loisel?= writes:
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.
context['foo'].absolute_url() Acquisition does only work for attribute(!) access ("getattr") and not subscription. Try:
context.foo.absolute_url() or getattr(context,'foo').absolute_url()
_['foo'].absolute_url() _.getitem('foo').absolute_url() Are you sure the namespace variable is bound? In many case, you will get an empty namespace. If your namespace is not empty, then the code above should work.
Dieter
9162
Age (days ago)
9162
Last active (days ago)
0 comments
1 participants
participants (1)
-
Dieter Maurer