[Zope-dev] DTML Method Aqusition vs. Python Method Aqusition in Products
trafik@torped.se
trafik@torped.se
Fri, 23 Jul 1999 03:14:06 +0200
Hi,
I'm looking for info about aqusition in Zope.
I have the following problem.
I have a Folder-object that I want to have
a index_html method.
I tried to to styles:
index_html=HTML('dtml_file',globals())
dtml_file:
<!--#var standard_html_header-->
<!--#var "aq_parent.id"--> (<!--#var "aq_parent.id"-->)<br>
<!--#var "aq_self.id"--> (<!--#var "aq_self.id"-->)<br>
<!--#var "aq_base.id"--> (<!--#var "aq_base.id"-->)<br>
<!--#var standard_html_footer-->
and
def index_html(self,REQUEST=None):
"""render Template
"""
return '''<html><body>
self.aq_parent: "%s (%s)",<br>
self.aq_self: "%s (%s)",<br>
self.aq_base: "%s (%s)",<br>
</body></html>'''% (
self.aq_parent.title,
self.aq_parent.id,
self.aq_self.title,
self.aq_self.id,
self.aq_base.title,
self.aq_base.id, )
When accessing from a subobject (i.e. aquiring index_html)
I get the following differens:
DTML method(http://localhost:9673/dddd/swedish/):
dddd (dddd)
swedish (swedish)
swedish (swedish)
Python method (http://localhost:9673/dddd/swedish/):
self.aq_parent: "Zope ()",
self.aq_self: "dddd (dddd)",
self.aq_base: "dddd (dddd)",
'dddd' is the folder containing the methods.
'swedish' doesn't is a folder not containing any
index_html.
Why does this happend? And where can I find docs or code
that would help me understand what going on here?
Best Regards,
Johan Carlsson