4 Dec
2002
4 Dec
'02
3:05 a.m.
Quoting Dieter Maurer <dieter@handshake.de>:
John K. Hohm writes:
I have a Page Template and Python Script that are working fairly well together to generate a navigational menu on my site, and now I want to make them part of a product. I have tried this:
The "context" equivalent in a Python product's method is usually "self.aq_parent"; the "container" equivalent "self.aq_inner.aq_parent".
I expected you to be right, so I tried a simple method like this: security.declarePublic('foo') def foo(self): """Test method""" return self.aq_parent.absolute_url() When called through the web, it displays the URL for the parent of the instance that defines foo, not the object on which I'm calling the method. Aargh!