示例#1
0
def get_human_readable_resource_name(resource: Resource) -> str:
    """Extract human-readable name of the resource for breadcrumbs."""
    # TODO: Add adapter implementation here
    if hasattr(resource, "get_title"):
        return resource.get_title()
    if hasattr(resource, "title"):
        return resource.title
    return resource.__name__
示例#2
0
def get_human_readable_resource_name(resource:Resource) -> str:
    """Extract human-readable name of the resource for breadcrumps."""

    # TODO: Add adapter implementation here

    if hasattr(resource, "get_title"):
        return resource.get_title()

    if hasattr(resource, "title"):
        return resource.title

    return resource.__name__