@frontend.route('/objects/search/')
@flask_login.login_required
def search():
    actions = get_sorted_actions_for_user(user_id=flask_login.current_user.id)
    user_language_id = get_user_language(flask_login.current_user).id
    action_types = get_action_types_with_translations_in_language(user_language_id)
    search_paths = {}
    search_paths_by_action = {}
    search_paths_by_action_type = {}
    for action_type in action_types:
        search_paths_by_action_type[action_type.id] = {}
    for action in actions:
        search_paths_by_action[action.id] = {}
        if (action.type_id not in search_paths_by_action_type):
            search_paths_by_action_type[action.type_id] = {}
        for (property_path, property_type) in logic.schemas.utils.get_property_paths_for_schema(schema=action.schema, valid_property_types={'text', 'bool', 'quantity', 'datetime'}).items():
            property_path = '.'.join(((key if (key is not None) else '?') for key in property_path))
            search_paths_by_action[action.id][property_path] = [property_type]
            if (property_path not in search_paths_by_action_type[action.type_id]):
                search_paths_by_action_type[action.type_id][property_path] = [property_type]
            elif (property_type not in search_paths_by_action_type[action.type_id][property_path]):
                search_paths_by_action_type[action.type_id][property_path].append(property_type)
            if (property_path not in search_paths):
                search_paths[property_path] = [property_type]
            elif (property_type not in search_paths[property_path]):
                search_paths[property_path].append(property_type)
    return (flask.render_template('search.html', search_paths=search_paths, search_paths_by_action=search_paths_by_action, search_paths_by_action_type=search_paths_by_action_type, actions=actions, action_types=action_types, datetime=datetime), 200, {'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0'})
@frontend.route('/objects/search/')
@flask_login.login_required
def search():
    actions = get_sorted_actions_for_user(user_id=flask_login.current_user.id)
    user_language_id = get_user_language(flask_login.current_user).id
    action_types = get_action_types_with_translations_in_language(user_language_id)
    search_paths = {}
    search_paths_by_action = {}
    search_paths_by_action_type = {}
    for action_type in action_types:
        search_paths_by_action_type[action_type.id] = {}
    for action in actions:
        search_paths_by_action[action.id] = {}
        if (action.type_id not in search_paths_by_action_type):
            search_paths_by_action_type[action.type_id] = {}
        for (property_path, property_type) in logic.schemas.utils.get_property_paths_for_schema(schema=action.schema, valid_property_types={'text', 'bool', 'quantity', 'datetime'}).items():
            property_path = '.'.join(((key if (key is not None) else '?') for key in property_path))
            search_paths_by_action[action.id][property_path] = [property_type]
            if (property_path not in search_paths_by_action_type[action.type_id]):
                search_paths_by_action_type[action.type_id][property_path] = [property_type]
            elif (property_type not in search_paths_by_action_type[action.type_id][property_path]):
                search_paths_by_action_type[action.type_id][property_path].append(property_type)
            if (property_path not in search_paths):
                search_paths[property_path] = [property_type]
            elif (property_type not in search_paths[property_path]):
                search_paths[property_path].append(property_type)
    return (flask.render_template('search.html', search_paths=search_paths, search_paths_by_action=search_paths_by_action, search_paths_by_action_type=search_paths_by_action_type, actions=actions, action_types=action_types, datetime=datetime), 200, {'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0'})