def query_enum_list_with_pagination(query_name: str,
                                    pagination: Pagination) -> DataPage:
    '''
    return template.query_with_pagination(ENUMS, pagination, Enum, query_dict={"name": regex.Regex(query_name)},
                                          sort_dict=["last_modified", pymongo.DESCENDING])
    '''
    return page_({"name": {
        "like": query_name
    }}, [("last_modified", "desc")], pagination, Enum, ENUMS)
Ejemplo n.º 2
0
def query_report_list_with_pagination(query_name: str, pagination: Pagination):
    '''
    return template.query_with_pagination(CONSOLE_REPORTS, pagination, Report,
                                          query_dict={"name": regex.Regex(query_name)},
                                          sort_dict=["last_modified", pymongo.DESCENDING])
    '''
    query_dict = {"name": {"like": query_name}}
    sort_dict = [("last_modified", "desc")]
    return page_(query_dict, sort_dict, pagination, Report, CONSOLE_REPORTS)
Ejemplo n.º 3
0
def query_topic_list_with_pagination(query_name: str,
                                     pagination: Pagination) -> DataPage:
    '''
    return template.query_with_pagination(TOPICS, pagination, Topic, query_dict={"name": regex.Regex(query_name)},
                                          sort_dict=["last_modified", pymongo.DESCENDING])
    '''
    # query_dict = {"name": regex.Regex(query_name)}
    # sort_dict = [{"last_modified": pymongo.DESCENDING}]
    query_dict = {"name": {"like": query_name}}
    sort_dict = [("last_modified", "desc")]
    return page_(query_dict, sort_dict, pagination, Topic, TOPICS)
Ejemplo n.º 4
0
def load_space_list_by_user_id_with_pagination(
        group_ids, pagination: Pagination) -> DataPage:
    # return mongo_template.query_with_pagination(SPACES, {"groupIds": {"$in": group_ids}}, pagination, Space)
    return page_({"groupIds": {
        "in": group_ids
    }}, [("spaceId", "desc")], pagination, Space, SPACES)
Ejemplo n.º 5
0
def query_space_with_pagination(query_name: str,
                                pagination: Pagination) -> DataPage:
    # return template.query_with_pagination(SPACES, pagination, Space, {"name": regex.Regex(query_name)})
    return page_({"name": {
        "like": query_name
    }}, [("name", "desc")], pagination, Space, SPACES)
Ejemplo n.º 6
0
def query_users_by_name_with_pagination(query_name: str,
                                        pagination: Pagination):
    # return template.query_with_pagination(USERS, pagination, User, {"name": regex.Regex(query_name)})
    return page_({"name": {
        "like": query_name
    }}, [("name", "desc")], pagination, User, USERS)
Ejemplo n.º 7
0
def query_user_groups_by_name_with_paginate(
        query_name: str, pagination: Pagination) -> DataPage:
    # return template.query_with_pagination(USER_GROUPS, pagination, UserGroup, {"name": regex.Regex(query_name)})
    return page_({"name": {
        "like": query_name
    }}, [("name", "desc")], pagination, UserGroup, USER_GROUPS)
Ejemplo n.º 8
0
def query_pipeline_monitor(topic_name, query, pagination):
    """
    return template.query_with_pagination(collection_name=build_collection_name(topic_name), pagination=pagination,
                                          query_dict=query)
    """
    return page_(query, None, pagination, None, topic_name)