Esempio n. 1
0
def show_image(id, i_id):
    ret = DB.iurlById(int(id))
    i_id = int(i_id)
    if i_id is None or i_id == 1:
        print("hello")
        return RedirectResponse(ret.url0)
    elif i_id == 2:
        return RedirectResponse(ret.url1)
    elif i_id == 3:
        return RedirectResponse(ret.url2)
Esempio n. 2
0
def show_all_fishes():
    r = DB.simpleItemSearch("category", 0)
    res = []
    for item in r:
        res.append(item)
    return res
Esempio n. 3
0
def show_one_onsaleproduct(id):
    r = DB.searchProductById(int(id))
    if r and r[0]["sale"] == True:
        return r
    else:
        raise HTTPException(status_code=404, detail="Item not found")
Esempio n. 4
0
def show_all_onsaleproducts():
    r = DB.simpleItemSearch("sale", True)
    res = []
    for item in r:
        res.append(item["name"])
    return res
Esempio n. 5
0
def show_all_availableproducts():
    r = DB.simpleItemSearch("availability", True)
    res = []
    for item in r:
        res.append(item["name"])
    return res
Esempio n. 6
0
def read_root():
    DB.initDB()
    return {"Hello": "World"}
Esempio n. 7
0
def show_all_coquillages():
    r = DB.simpleItemSearch("category", 1)
    res = []
    for item in r:
        res.append(item)
    return res
Esempio n. 8
0
def updateDB():
    r = requests.get(url=ADRESS_CANVA + "tig/products")
    DB.updateProductsTable(r.json())
Esempio n. 9
0
def show_all_crustaces():
    r = DB.simpleItemSearch("category", 2)
    res = []
    for item in r:
        res.append(item)
    return res