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
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
def list_accounts_json(): object = quorum.get_object( alias = True, find = True, sort = [("username", 1)] ) accounts = models.Account.find(map = True, **object) return accounts
def list_devices_json(): object = quorum.get_object( alias = True, find = True, sort = [("name", 1)] ) devices = models.Device.find(map = True, **object) return devices
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)
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)
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)
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)
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)