[ZCM] [ZC] 1308/ 7 Comment "Need "actual URL" method"
Collector: Zope Bugs, Features,
and Patches ...
zope-coders-admin at zope.org
Mon Aug 23 11:38:38 EDT 2004
Issue #1308 Update (Comment) "Need "actual URL" method"
Status Rejected, Zope/feature+solution medium
To followup, visit:
http://zope.org/Collectors/Zope/1308
==============================================================
= Comment - Entry #7 by regebro on Aug 23, 2004 11:38 am
It would be interesting to know what path you WANT, in the above use case.
There is now absolute_url, the extremely silly absolute_url(relative=1), absolute_url_path, virtual_url_path, getPhysicalPath, getPhysicalRoot, request/URLx and request/VIRTAUL_URL. Although this set is highly confusing, it is for most cases enough.
________________________________________
= Comment - Entry #6 by ajung on Jul 30, 2004 9:18 am
I think the request contains enough informations to produce
that you need. Working with absolute_url() is usually sufficient. If not then it indicates at least a weird or seldom usecase.
________________________________________
= Comment - Entry #5 by dchandek on Jul 30, 2004 9:10 am
> What's wrong with object/absolute_url? or request/url?
A use case:
requested URL from client: http://my.host/path/to/script/parameter
request/URL = http://my.host/path/to/script
script/absolute_url = http://my.host/path/to/script
request/VIRTUAL_URL = http://my.host/path/to/script/parameter
________________________________________
= Reject - Entry #4 by chrisw on Jul 30, 2004 7:49 am
Status: Deferred => Rejected
What's wrong with object/absolute_url? or request/url?
________________________________________
= Defer - Entry #3 by ajung on May 14, 2004 1:12 am
Status: Pending => Deferred
I made a reference to #1252 to this issue. Closing this issue to keep the related discussion in one issue only.
________________________________________
= Edit - Entry #2 by ajung on May 12, 2004 8:55 am
Changes: submitter email, importance (critical => medium)
________________________________________
= Request - Entry #1 by dchandek on May 3, 2004 5:07 pm
This is related to issue 1252.
Need a way to print the _actual_ URL of a "page".
For example, "The URL of this page is <span tal:replace="request/actual_url">URL</span>.
Here's a possible solution candidate:
request = container.REQUEST
qs = request.QUERY_STRING
if request.has_key('VIRTUAL_URL'):
base_url = request.VIRTUAL_URL
else:
base_url = request.URL
url = base_url + ( qs and ( '?%s' % qs ) )
return url
something like that ...
Thanks,
David
==============================================================
More information about the Zope-Collector-Monitor
mailing list