Exemple #1
0
def get_order():
    name = request.args.get('name', 'Hans')
    phone = request.args.get('phone', '1234')
    csr = g.db.execute('SELECT description, price FROM entries ORDER BY id ASC')
    orders = [Order(description, price) for description, price in csr.fetchall()]
    tmp = print_order(orders, name, phone)
    return send_file(tmp.name)
Exemple #2
0
def get_order():
    csr = g.db.execute('SELECT description, price FROM entries ORDER BY id ASC')
    pizzas, prices = zip(*csr.fetchall())
    fname = print_order(pizzas, prices)
    return send_file(fname)