[Zope-dev] closed collector issues 1252 and 1308

Chris Withers chris at simplistix.co.uk
Tue Aug 31 06:09:03 EDT 2004


Paul Winkler wrote:

> But occasionally it's really handy to know. 
> It's a wheel that people get to occasionally reinvent for no good reason, 
> and while it's not rocket science to get it right, it IS way too easy 
> to get wrong.

Yep, this sounds like a documentation problem, no a "we need mroe code" 
problem...

>>>absolute_url_path
>>>- is usable with VHM, but still containment only.
>>>
>>>virtual_url_path
>>>- is usable with VHM, but still containment only.
>>
>>Again, what do both of these do?
> 
> 
> virtual_url_path replaces absolute_url(relative=1) which IIRC is 
> going to be deprecated because everybody hates the inherent
> absurdity of it.  

but WHAT DOES IT DO?! ;-)

> Anyway, neither of them include "contextual elements" as described
> above. Nor do they give you access to the traverse_subpath.
> So they do not fit the use case.

OK.

> This says nothing about URLs because that's not the intended usage.
> Maybe a warning about this should be added to the docstring to make it 
> explicit.  

Maybe... How's the API reference code coming? ;-)

>>>request/URLx 
>>>- close, but no cigar: leaves out traverse_subpath elements.
>>
>>Really? 
> 
> Yes, really. 
> 
> 
>>Should it?
> 
> Good question! Why the heck doesn't it?
> Seems counterintuitive to me.

Indeed. Can we propose this as a change for 2.8?
Would sir care to open a collector issue? ;-)

>>Interesting. What's wrong with just:
>>
>>python:request.URL+'/'+'/'.join(request.traverse_subpath)+'?'+REQUEST.QUERY_STRING
>>
>>?
> 
> It's a mouthful, and it's non-obvious.

This is an edge use case, if that, I don't think it's too much to ask to 
shove the above in a python script if people need it...

> And, one nitpick: if traverse_subpath is empty, this idiom adds a spurious 
> trailing slash.

...which doesn't matter one iota to Zope, but does illustrate my point. 
This kind of URL building is very problem specific, with each person 
wanting something slightly different. Adding more methodz to cope, or 
one method with a myriad of options doesn't feel like the right way to 
go about it to me...

> I would rather have request/URL include the traverse_subpath.

me too!

> Either that or have request/VIRTUAL_URL always available,
> as proposed earlier in this thread.

*shrugs* What needs to happen for that to be the case?
(maybe include in the collector entry I know you're itching to open ;-)

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope-Dev mailing list