[Zope] anchor tags in python

J Cameron Cooper jccooper@jcameroncooper.com
Thu, 08 May 2003 13:52:22 -0500


>
>
>I was wondering how to pass a page anchor in a python script...
>
>
>My script:
>----------
>import string
>import types
>
>form=context.REQUEST.form
>
># do some processing, etc...
>
># return the birds page at the anchor (how???)
>
>joint = container['birds']
>return joint()
>  
>
Build a URL for the anchor and page and the use 
REQUEST.RESPONSE.redirect(url) to go there.

You should probably be paranoid and use absolute_url on the page and the 
Python Scripts url quoting function on the anchor, though you could just say

anchor = 'birdsong'      # or whatever
url = 'birds#' + anchor

    --jcc