Пример #1
0
def edit_product(product_id):
    if request.method == 'GET':
        product = Product.get_product(product_id)
        return render_template('edit_product.html', product=product)
    elif request.method == 'POST':
        product = request.form['product']
        url = request.form['url']
        image_url = request.form['image-url']
        introduction = request.form['introduction']

        Product.edit_product(product_id, product, url, image_url, introduction)
        return redirect(url_for('single_product', product_id=product_id))
Пример #2
0
def edit_product(product_id):	
	if request.method == 'GET':
		product = Product.get_product(product_id)
		return render_template('product/edit_product.html', product=product)
	else:
		product = request.form['product']
		url = request.form['url']
		image_url = request.form['image-url']
		introduction = request.form['introduction']

		Product.edit_product(product_id, product, url, image_url, introduction)
		return redirect(url_for('single_product', product_id=product_id))