def loop_histroy(): while 1: if gl.CREATEDQUE.empty(): query = Upload.select().where(Upload.uploadflag == False).limit(5) for i in query: gl.CREATEDQUE.put({'fresh': False, 'path': i.path, 'id': i.id}) time.sleep(2)
def get_test3(): u = Upload.select().order_by(Upload.uploadflag,Upload.timestamp).limit(10) print u for i in u: print i
def get_test2(): u = Upload.select().where(Upload.uploadflag == False).limit(5) print u for i in u: print i.path
def get_test(): u = Upload.select().order_by(Upload.id.desc()).limit(10) for i in u: print i