Пример #1
0
def get_pointed(auth, node, **kwargs):
    """View that returns the pointers for a project."""
    # exclude folders
    return {'pointed': [
        serialize_pointer(each, auth)
        for each in node.pointed
        if not get_pointer_parent(each).is_folder
    ]}
Пример #2
0
def get_pointed(auth, node, **kwargs):
    """View that returns the pointers for a project."""
    # exclude folders
    return {'pointed': [
        serialize_pointer(each, auth)
        for each in node.pointed
        if not get_pointer_parent(each).is_folder
    ]}
Пример #3
0
def serialize_pointer(pointer, auth):
    node = get_pointer_parent(pointer)
    if node.can_view(auth):
        return {
            'id': node._id,
            'url': node.url,
            'title': node.title,
            'authorShort': abbrev_authors(node),
        }
    return {
        'url': None,
        'title': 'Private Component',
        'authorShort': 'Private Author(s)',
    }
Пример #4
0
def serialize_pointer(pointer, auth):
    node = get_pointer_parent(pointer)
    if node.can_view(auth):
        return {
            'id': node._id,
            'url': node.url,
            'title': node.title,
            'authorShort': abbrev_authors(node),
        }
    return {
        'url': None,
        'title': 'Private Component',
        'authorShort': 'Private Author(s)',
    }
Пример #5
0
def serialize_pointer(pointer, auth):
    node = get_pointer_parent(pointer)
    if node.can_view(auth):
        return {"id": node._id, "url": node.url, "title": node.title, "authorShort": abbrev_authors(node)}
    return {"url": None, "title": "Private Component", "authorShort": "Private Author(s)"}