예제 #1
0
def select_all_models(restful):
    query = Models.query.filter_by(**restful.filters)
    query = database.full_text_search(query, restful.q, [
        Models.model_name, Models.model_path, Models.dataset, Models.updated_on
    ])
    query = query.order_by(*database.get_order_by(Models, restful.order_by))
    return database.get_list(query, restful.pagination)
예제 #2
0
def select_role(restful):
    query = Role.query.filter_by(**restful.filters)
    query = database.full_text_search(
        query, restful.q,
        [User.username, User.first_name, User.last_name, User.email])
    query = query.order_by(*database.get_order_by(User, restful.order_by))
    return database.get_list(query, restful.pagination)
예제 #3
0
def get_attribute_list(restful):
    query = Attribute.query.filter_by(**restful.filters)
    query = database.full_text_search(query, restful.q,
                                      [Attribute.attribute_name])
    query = query.order_by(*database.get_order_by(Attribute, restful.order_by))
    return database.get_list(query, restful.pagination)
예제 #4
0
def select_agent(restful):
    query = Agent.query.filter_by(**restful.filters)
    query = database.full_text_search(query, restful.q, [Agent.area])
    query = query.order_by(*database.get_order_by(Agent, restful.order_by))
    return database.get_list(query, restful.pagination)
예제 #5
0
def select_all_camera(restful):
    query = Camera.query.filter_by(**restful.filters)
    query = database.full_text_search(query, restful.q, [Camera.camera_id])
    query = query.order_by(*database.get_order_by(Camera, restful.order_by))
    # query = get_json_clean_response(Models.query.all())
    return database.get_list(query, restful.pagination)
예제 #6
0
def select_all_attributes(restful):
    query = Image.query.filter_by(**restful.filters)
    query = database.full_text_search(query, restful.q, [Image.flagging])
    query = query.order_by(*database.get_order_by(Image, restful.order_by))
    return database.get_list(query, restful.pagination)
예제 #7
0
def get_category_list(restful):
    query = Category.query.filter_by(**restful.filters)
    query = database.full_text_search(query, restful.q,
                                      [Category.category_name])
    query = query.order_by(*database.get_order_by(Category, restful.order_by))
    return database.get_list(query, restful.pagination)
예제 #8
0
def select_image(restful):
    query = Image.query.filter_by(**restful.filters)
    query = database.full_text_search(query, restful.q, [Image.area])
    query = query.order_by(*database.get_order_by(Image, restful.order_by))
    return database.get_list(query, restful.pagination)
예제 #9
0
def get_list(restful):
    query = Dataset.query.filter_by(**restful.filters)
    query = database.full_text_search(query, restful.q, [Dataset.area])
    query = query.order_by(*database.get_order_by(Dataset, restful.order_by))
    return database.get_list(query, restful.pagination)