def get_resource_path(resource):
    """ Return the full path for the resource (with or without a parent).
    """
    return ("%s/%s" % (resource.parent and resource.parent.id or '',
                                resource.id.lstrip('/'))).lstrip('/')