本文整理汇总了Python中models.Order.payment_method方法的典型用法代码示例。如果您正苦于以下问题:Python Order.payment_method方法的具体用法?Python Order.payment_method怎么用?Python Order.payment_method使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Order
的用法示例。
在下文中一共展示了Order.payment_method方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: complete_order
# 需要导入模块: from models import Order [as 别名]
# 或者: from models.Order import payment_method [as 别名]
def complete_order(request):
request.session.set_expiry(0)
cart = request.session["cart"]
order = Order()
order.first_name = request.POST["first_name"]
order.last_name = request.POST["last_name"]
order.address = request.POST["address"]
order.city = request.POST["city"]
order.payment_method = request.POST["payment"]
order.payment_data = request.POST["payment_data"]
order.items = gen_items_list(cart)
request.session["cart"] = []
return render(request, "mystore/complete_order.html", None)
示例2: completeOrder
# 需要导入模块: from models import Order [as 别名]
# 或者: from models.Order import payment_method [as 别名]
def completeOrder(request):
request.session.set_expiry(0)
cart = request.session['cart']
order = Order()
order.first_name = request.POST['first_name']
order.last_name = request.POST['last_name']
order.address = request.POST['address']
order.city = request.POST['city']
order.payment_method = request.POST['payment']
order.payment_data = request.POST['payment_data']
order.items = genItemsList(cart)
request.session['cart'] = []
return render(request, "complete_order.html", None)
示例3: completeOrder
# 需要导入模块: from models import Order [as 别名]
# 或者: from models.Order import payment_method [as 别名]
def completeOrder(request):
cart = request.session['cart']
request.session.set_expiry(0)
ctx = {'cart':cart, 'cart_size':len(cart), 'cart_items':cartItems(cart), 'total_price': priceCart(cart)}
order = Order()
order.items = genItemsList(cart)
order.first_name = request.POST['first_name']
order.last_name = request.POST['last_name']
order.address = request.POST['address']
order.city = request.POST['city']
order.payment_data = request.POST['payment_data']
order.fulfilled = False
order.payment_method = request.POST['payment']
order.save()
request.session['cart'] = []
return render(request, "complete_order.html", ctx)