invenio_migrator/legacy/records.py
def get_record_collections(recid):
    """Get all collections the record belong to."""
    try:
        from invenio.search_engine import (
            get_all_collections_of_a_record,
            get_restricted_collections_for_recid)
    except ImportError:
        from invenio.legacy.search_engine import (
            get_all_collections_of_a_record,
            get_restricted_collections_for_recid)

    collections = {
        'all':
        get_all_collections_of_a_record(recid, recreate_cache_if_needed=False),
    }
    collections['restricted'] = dict(
        (coll, _get_collection_restrictions(coll))
        for coll in get_restricted_collections_for_recid(
                recid, recreate_cache_if_needed=False))

    return collections
def get_record_collections(recid):
    """Get all collections the record belong to."""
    try:
        from invenio.search_engine import (
            get_all_collections_of_a_record,
            get_restricted_collections_for_recid)
    except ImportError:
        from invenio.legacy.search_engine import (
            get_all_collections_of_a_record,
            get_restricted_collections_for_recid)

    collections = {
        'all':
        get_all_collections_of_a_record(recid, recreate_cache_if_needed=False),
    }
    collections['restricted'] = dict(
        (coll, _get_collection_restrictions(coll))
        for coll in get_restricted_collections_for_recid(
                recid, recreate_cache_if_needed=False))

    return collections
Get all collections the record belong to.