本文整理汇总了Python中shop.views.cart.CartDetails.as_view方法的典型用法代码示例。如果您正苦于以下问题:Python CartDetails.as_view方法的具体用法?Python CartDetails.as_view怎么用?Python CartDetails.as_view使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shop.views.cart.CartDetails
的用法示例。
在下文中一共展示了CartDetails.as_view方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: patterns
# 需要导入模块: from shop.views.cart import CartDetails [as 别名]
# 或者: from shop.views.cart.CartDetails import as_view [as 别名]
from django.conf.urls import patterns, url
from shop.views.cart import CartDetails, CartItemDetail
urlpatterns = patterns('',
url(r'^delete/$', CartDetails.as_view(action='delete'), # DELETE
name='cart_delete'),
url(r'^item/$', CartDetails.as_view(action='post'), # POST
name='cart_item_add'),
url(r'^$', CartDetails.as_view(), name='cart'), # GET
url(r'^update/$', CartDetails.as_view(action='put'),
name='cart_update'),
# CartItems
url(r'^item/(?P<id>[0-9]+)$', CartItemDetail.as_view(),
name='cart_item'),
url(r'^item/(?P<id>[0-9]+)/delete$',
CartItemDetail.as_view(action='delete'),
name='cart_item_delete'),
)
示例2: patterns
# 需要导入模块: from shop.views.cart import CartDetails [as 别名]
# 或者: from shop.views.cart.CartDetails import as_view [as 别名]
from shop.views import ShopDetailView, ShopListView, ShopTemplateView
from shop.views.cart import CartDetails
from shop.views.category import CategoryDetailView
from shop.views.checkout import SelectShippingView
from shop.views.product import ProductDetailView
# Loop through payment backends and mount the modules in pay/
urlpatterns = patterns('',
(r'^pay/$', include('shop.payment.urls')),
(r'^ship/$', include('shop.shipping.urls')),
#Home
url(r'^$', ShopTemplateView.as_view(template_name="shop/welcome.html")),
# Cart
url(r'^cart/$', CartDetails.as_view(),
name='cart' # NOT cart_detail since we can POST to it to add stuff
),
# Checkout
url(r'^checkout/$', SelectShippingView.as_view(),
name='checkout' # NOT cart_detail since we can POST to it to add stuff
),
# Products
url(r'^product/(?P<slug>[0-9A-Za-z-_.//]+)/$',
ProductDetailView.as_view(),
name='product_detail'
),
url(r'^products/$',
ShopListView.as_view(model=Product),
示例3: url
# 需要导入模块: from shop.views.cart import CartDetails [as 别名]
# 或者: from shop.views.cart.CartDetails import as_view [as 别名]
# Accessories
url(r'^accessories/$',
AccessoryListView.as_view(),
name='accessory-list'
),
url(r'^accessories/(?P<slug>[0-9A-Za-z-_.//]+)$',
AccessoryDetailView.as_view(),
name='accessory_detail'
),
# Payment stuff
(r'^pay/', include('shop.payment.urls')),
(r'^ship/', include('shop.shipping.urls')),
# Cart
url(r'^cart/delete/$', # DELETE
CartDetails.as_view(action='delete'),
name='cart_delete'
),
url(r'^cart/delete/(?P<pk>\d+)/$',
CartItemDeleteView.as_view(),
name='cart_delete_single'
),
url('^cart/item/$', # POST
CartDetails.as_view(action='post'),
name='cart_item_add'
),
url(r'^cart/$', # GET
CartDetails.as_view(template_name="customshop/cart.html"),
name='cart'
),
url(r'^cart/update/$',
示例4: import
# 需要导入模块: from shop.views.cart import CartDetails [as 别名]
# 或者: from shop.views.cart.CartDetails import as_view [as 别名]
from morozoff.apps.customshop.models import CustomProduct
from morozoff.apps.customshop.views import (MyCheckoutSelectionView,
CartItemDeleteView, CustomCategoryShopListView)
urlpatterns = patterns('',
# Products
url(r'^$',
TemplateView.as_view(template_name="index.html"),
name='index'
),
(r'^pay/', include('shop.payment.urls')),
(r'^ship/', include('shop.shipping.urls')),
# Cart
url(r'^cart/delete/$',
CartDetails.as_view(action='delete'),
name='cart_delete'
),
url(r'^cart/delete/(?P<pk>\d+)/$',
CartItemDeleteView.as_view(),
name='cart_delete_single'
),
url('^cart/item/$',
CartDetails.as_view(action='post'),
name='cart_item_add'
),
url(r'^cart/$',
CartDetails.as_view(),
name='cart'
),
url(r'^cart/update/$',
示例5: url
# 需要导入模块: from shop.views.cart import CartDetails [as 别名]
# 或者: from shop.views.cart.CartDetails import as_view [as 别名]
from django.conf.urls import url
from shop.views.cart import CartDetails, CartItemDetail
urlpatterns = [
url(r"^delete/$", CartDetails.as_view(action="delete"), name="cart_delete"), # DELETE
url(r"^item/$", CartDetails.as_view(action="post"), name="cart_item_add"), # POST
url(r"^$", CartDetails.as_view(), name="cart"), # GET
url(r"^update/$", CartDetails.as_view(action="put"), name="cart_update"),
# CartItems
url(r"^item/(?P<id>[0-9]+)$", CartItemDetail.as_view(), name="cart_item"),
url(r"^item/(?P<id>[0-9]+)/delete$", CartItemDetail.as_view(action="delete"), name="cart_item_delete"),
]