Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def product_info(request):
- if request.session.is_empty():
- return redirect(customer_view.login)
- else:
- if request.method == "POST":
- product_name = request.POST['product_name']
- description = request.POST['description']
- price = request.POST['price']
- warranty = request.POST['warranty']
- total_product = request.POST['total_product']
- #$
- buying_price = request.POST['buying_product']
- dict = {'product_name':product_name, 'description':description, 'price':price, 'warranty':warranty, 'total_product':total_product}
- cursor = connection.cursor()
- sql = "INSERT INTO HISTORY(NAME, STOCK, PRICE, DESCRIPTION, WARRANTY,BUYING_PRICE) " \
- "VALUES(%s, %s, %s, %s, %s)"
- cursor.execute(sql, [product_name, total_product, price, description, warranty, buying_price])
- connection.commit()
- cursor.close()
- return redirect(imei_entry_load)
- else:
- return render(request, "Product_Info.html")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement