Esempio n. 1
0
def add_foods_bluepot():
    if request.method == 'POST':
        add_bluepot = mongo.db.bluepotdrinks

        add_bluepot.insert_one({
            'title': request.form.get('title'),
            'description': request.form.get('description'),
            'price': request.form.get('price'),
            'ingredient': request.form.get('ingredient'),
            'url': request.form.get('url')
        })

        return redirect(url_for('foods_bluepot'))

    form = addfoodsForm()
    return render_template('add_foods_bluepot.html', form=form)
Esempio n. 2
0
def add_foods_gaonnuri():
    if request.method == 'POST':
        add_gaonnuri = mongo.db.gaonnurifoods

        add_gaonnuri.insert_one({
            'title': request.form.get('title'),
            'description': request.form.get('description'),
            'price': request.form.get('price'),
            'ingredient': request.form.get('ingredient'),
            'url': request.form.get('url')
        })

        return redirect(url_for('foods_gaonnuri'))

    form = addfoodsForm()
    return render_template('add_foods_gaonnuri.html', form=form)