search ported to fastapi

This commit is contained in:
boyska 2020-12-15 15:19:45 +01:00
parent 97d6e65bb8
commit c36a1ea0cc

View file

@ -76,7 +76,7 @@ def create():
now = datetime.now()
start = date_read(req["starttime"]) if "starttime" in req else now
name = req["name"] if "name" in req else u""
name = req["name"] if "name" in req else ""
end = date_read(req["endtime"]) if "endtime" in req else now
rec = Rec(name=name, starttime=start, endtime=end)
@ -222,15 +222,15 @@ def check_job(job_id: int):
@app.get("/api/jobs")
def running_jobs():
res = {}
res["last_job_id"] = self._app.pq.last_job_id
res["running"] = self._app.pq.jobs.keys()
res["last_job_id"] = pq.last_job_id
res["running"] = pq.jobs.keys()
return res
@app.get("/api/get/search")
def search(args=None):
def search(request: Request):
req = dict()
req.update(request.GET.allitems())
req.update(request.query_params.items())
logger.debug("Search request: %s" % (req))
values = db._search(**req)