[Zope-dev] Re: Post-mortem [Was: Zope 2.7.0 b3 regressions]

Paul Winkler pw_lists at slinkp.com
Tue Dec 9 11:57:28 EST 2003


On Tue, Dec 09, 2003 at 10:24:47AM -0600, Evan Simpson wrote:
> def absolute_url_path(self):
>    '''Return the entire path of the absolute URL for this object.
>       This includes the leading slash, and can be used as an
>       "absolute-path reference" as defined in RFC 2396.
>    '''

OK. But maybe the docstrings could be more clear about
BASEPATH1?  IIUC, absolute_url(1) will leave out BASEPATH1, 
continuing the behavior from zope < 2.7, but absolute_url_path() will
include BASEPATH1?

I propose this, in OFSP/help/ObjectManagerItem.py:

def absolute_url_path(self):
    '''
    Return the entire path portion of the absolute URL for this object.

    This includes the leading slash and BASEPATH1, and can be used 
    as an "absolute-path reference" as defined in RFC 2396.
    Thus, this method is always safe to use with VirtualHostMonster.
    '''

def absolute_url(relative=None):
    """
    Return the absolute url to the object.

    If the relative argument is provided with a true value, then
    the URL returned is relative to the site object. Does not include 
    a leading slash or BASEPATH1, thus is not always safe to
    use with VirtualHostMonster. Code that uses '/'+absolute_url(1)
    should be changed to use absolute_url_path instead.

    Permission -- Always available
    """

I removed the "logical rather than physical" note from absolute_url
because I don't think it was actually true before Evan's change,
which IIUC is being reverted. Maybe I misunderstood.

> Lennart proposed additional methods, but I'm going to work on that in 
> the post-2.7 branches, since I really want to clean up this mess 
> properly, and beta 3 isn't the time.

Great.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's HYPO-SUPERCALIFRAGILISTICEXPIALADOCIOUS THIGH MAN!
(random hero from isometric.spaceninja.com)



More information about the Zope-Dev mailing list