[Zope] Returning a PageTemplate within a Disk-based Product always
returns the aq_parent, not the ZPT itself
nicogrubert at arcor.de
nicogrubert at arcor.de
Thu Dec 11 05:06:27 EST 2003
Hi there,
I am developing a disk based python product for Zope.
I only have one class which inherits from the base class Folder.
Within that class I have defined a method "add_author". Inside this method
I want to return a Page Template like this:
# get the page template object
input_form = getattr(self.authors, 'Add_Author.html')
# put a dictionary into the REQUEST object
msg={}
msg['a'] = 'msg a'
msg['b'] = 'msg b'
REQUEST['msg'] = msg
# return the page template
return input_form(REQUEST)
'authors' is a normal Zope folder. In the 'authors' folder I have created a Page Template
called 'Add_Author.html'.
I do not want to use REQUEST.RESPONSE.redirect() to return the Page Template, because
I need to pass a dictionary 'msg' which I put in the REQUEST object.
So I use return input_form(REQUEST) to return the Page Template 'Add_Author.html'.
My Problem is:
When returning the Page Template with return input_form(REQUEST), Zope does not show
the URL "http://localhost:8080/MyProductInstance/authors/Add_Author.html" but the URL
"http://localhost:8080/MyProductInstance/authors/".
Can anybody tell me, why Zope returns the URL "http://localhost:8080/MyProductInstance/authors/" insted of "http://localhost:8080/MyProductInstance/authors/Add_Author.html" which is the absolute_url() of the Page Template?
How do I get Zope to show the proper URL: "http://localhost:8080/MyProductInstance/authors/Add_Author.html" ?
Thank you in advance,
-nico
More information about the Zope
mailing list