[Zope] Returning a PageTemplate within a Disk-based Product always returns the aq_parent, not the ZPT itself

Peter Sabaini peter at sabaini.at
Thu Dec 11 06:05:28 EST 2003


I'm not sure what you mean by "show" -- where does Zope show you this 
URL? If you're talking about your browsers address bar, this will be the 
same as the original request to your product instance, since you are 
staying within the same HTTP request (when returning the page, instead 
of redirecting)

  - peter.

nicogrubert at arcor.de wrote:
> 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
> 
> 
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3461 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mail.zope.org/pipermail/zope/attachments/20031211/5f9953c1/smime.bin


More information about the Zope mailing list