예제 #1
0
def post():
    name = request.form['name']
    print(name)
    location = request.form['location']
    print(location)
    healthy = request.form['healthy']
    print(healthy)
    item = Product()
    item.name = name
    item.healthy = healthy
    item.location = location
    db.session.add(item)
    db.session.commit()
    response = jsonify({
        'message': 'Satllite added',
        'satllite': item.to_json()
    })
    return response