示例#1
0
def list_cameras_json():
    object = quorum.get_object(
        alias = True,
        find = True,
        sort = [("camera_id", 1)]
    )
    cameras = models.Camera.find_a(map = True, **object)
    return cameras
示例#2
0
def list_sets_json():
    object = quorum.get_object(
        alias = True,
        find = True,
        sort = [("name", 1)]
    )
    sets = models.Set.find_a(map = True, **object)
    return sets
示例#3
0
def list_accounts_json():
    object = quorum.get_object(
        alias = True,
        find = True,
        sort = [("username", 1)]
    )
    accounts = models.Account.find(map = True, **object)
    return accounts
示例#4
0
def list_devices_json():
    object = quorum.get_object(
        alias = True,
        find = True,
        sort = [("name", 1)]
    )
    devices = models.Device.find(map = True, **object)
    return devices
示例#5
0
def list_cameras_api():
    object = quorum.get_object(
        alias = True,
        find = True,
        limit = 0,
        sort = [("camera_id", 1)]
    )
    cameras = models.Camera.find_a(map = True, **object)
    return dict(cameras = cameras)
示例#6
0
def list_sets_api():
    object = quorum.get_object(
        alias = True,
        find = True,
        limit = 0,
        sort = [("name", 1)]
    )
    sets = models.Set.find_a(map = True, **object)
    return dict(sets = sets)
示例#7
0
def list_devices_api():
    object = quorum.get_object(
        alias = True,
        find = True,
        limit = 0,
        sort = [("name", 1)]
    )
    devices = models.Device.find(map = True, **object)
    return dict(devices = devices)
示例#8
0
def list_sets_m_api():
    object = quorum.get_object(
        alias = True,
        find = True,
        limit = 0,
        sort = [("name", 1)]
    )
    sets = models.Set.find_a(**object)
    for set in sets: set.merge_cameras()
    return dict(sets = sets)
示例#9
0
def list_cameras_m_api():
    object = quorum.get_object(
        alias = True,
        find = True,
        limit = 0,
        sort = [("camera_id", 1)]
    )
    cameras = models.Camera.find_a(**object)
    for camera in cameras:
        camera.merge_device()
        camera.filter_device()
    return dict(cameras = cameras)