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)
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)
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)
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)
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)
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)
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)
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)