def get_contact_objects(current_user, contact):

    objects = dict(CONTACT_OBJECTS)

    for key in objects:
        if hasattr(contact, key):
            manager = getattr(contact, key)
            try:
                manager = manager.filter(status__hidden=False)
            except:
                pass
            objects[key]['objects'] = Object.filter_permitted(
                current_user, manager)

    return objects
Returns a dictionary with keys specified as contact attributes
dataset/ETHPy150Open treeio/treeio/treeio/projects/identities.py/get_contact_objects