示例#1
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))
示例#2
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))
示例#3
0
def single_product(product_id):
    product = Product.get_product(product_id)
    product['Introduction'] = markdown2.markdown(product['Introduction'])
    return render_template('single_product.html', product=product)
示例#4
0
def single_product(product_id):
    product = Product.get_product(product_id)
    return render_template('single_product.html', product=product)
示例#5
0
def single_product(product_id):
	product = Product.get_product(product_id)
	if not product:
		abort(404)
	product['Introduction'] = markdown2.markdown(product['Introduction'])
	return render_template('product/single_product.html', product=product)
示例#6
0
def single_product(product_id):
	product = Product.get_product(product_id)
	return render_template('single_product.html', product=product)
示例#7
0
def single_product(product_id):
    product = Product.get_product(product_id)
    if not product:
        abort(404)
    product['Introduction'] = markdown2.markdown(product['Introduction'])
    return render_template('product/single_product.html', product=product)
示例#8
0
def single_product(product_id):
	product = Product.get_product(product_id)
	product['Introduction'] = markdown2.markdown(product['Introduction'])
	return render_template('single_product.html', product=product)