Thanks to visit codestin.com
Credit goes to github.com

Skip to content

plone.api.get_path #580

@yurj

Description

@yurj

def get_path(obj=None, relative=False):

for the relative part, we already have:

https://github.com/zopefoundation/Zope/blob/d16ffc26d2d9aa3657ebad053ff9085e71f86984/src/OFS/Traversable.py#L79

that returns the relative path and seems to support more use cases. The only difference is the / prefix but being from the portal, it does not change the meaning, you can just use absolute_url_path and remove the /.

Note: I think that having the / prefix is better because this is an 'absolute-path reference':
https://github.com/zopefoundation/Zope/blob/d16ffc26d2d9aa3657ebad053ff9085e71f86984/src/OFS/Traversable.py#L80-L84

        """Return the path portion of the absolute URL of the object.

        This includes the leading slash, and can be used as an
        'absolute-path reference' as defined in RFC 2396.
        """

but this is not important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions