コード例 #1
0
ファイル: views.py プロジェクト: MechanisM/django-shop
    def test_select_shipping_view(self):
        self.create_fixtures()

        request = Mock()
        setattr(request, 'is_ajax', lambda : False)
        setattr(request, 'user', self.user)
        post={
            'add_item_id':self.product.id,
            'add_item_quantity':1,
        }

        view = SelectShippingView(request=request)
        view.create_order_object_from_cart()
コード例 #2
0
    def test_select_shipping_view(self):
        self.create_fixtures()

        request = Mock()
        setattr(request, 'is_ajax', lambda: False)
        setattr(request, 'user', self.user)
        post = {
            'add_item_id': self.product.id,
            'add_item_quantity': 1,
        }

        view = SelectShippingView(request=request)
        view.create_order_object_from_cart()
コード例 #3
0
ファイル: urls.py プロジェクト: bbelchak/django-shop
# 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),
        name='product_list'
        ),
        
    # Categories
    url(r'^categories/$',
コード例 #4
0
    
    # Cart
    url(r'^cart/delete/$', CartDetails.as_view(action='delete'), # DELETE 
        name='cart_delete'),
    url('^cart/item/$', CartDetails.as_view(action='post'), # POST
        name='cart_item_add' ),
    url(r'^cart/$', CartDetails.as_view(), name='cart'), # GET
    url(r'^cart/update/$', CartDetails.as_view(action='put'), 
        name='cart_update'),

    # CartItems
    url('^cart/item/(?P<id>[0-9A-Za-z-_.//]+)$', CartItemDetail.as_view(),
        name='cart_item' ),
    
    # Checkout
    url(r'^checkout/ship/$', SelectShippingView.as_view(), 
        name='checkout_shipping' # First step of the checkout process
        ),
    url(r'^checkout/pay/$', SelectPaymentView.as_view(), 
        name='checkout_payment' # Second step of the checkout process
        ),
    
    # Products
    url(r'^products/$',
        ShopListView.as_view(model=Product),
        name='product_list'
        ),
    url(r'^products/(?P<slug>[0-9A-Za-z-_.//]+)/$',
        ProductDetailView.as_view(),
        name='product_detail'
        ),
コード例 #5
0
        CartDetails.as_view(action='post'),  # POST
        name='cart_item_add'),
    url(r'^cart/$', CartDetails.as_view(), name='cart'),  # GET
    url(r'^cart/update/$',
        CartDetails.as_view(action='put'),
        name='cart_update'),

    # CartItems
    url('^cart/item/(?P<id>[0-9A-Za-z-_.//]+)$',
        CartItemDetail.as_view(),
        name='cart_item'),

    # Checkout
    url(
        r'^checkout/ship/$',
        SelectShippingView.as_view(),
        name='checkout_shipping'  # First step of the checkout process
    ),
    url(
        r'^checkout/pay/$',
        SelectPaymentView.as_view(),
        name='checkout_payment'  # Second step of the checkout process
    ),
    url(
        r'^checkout/thank_you/$',
        ThankYouView.as_view(),
        name='thank_you_for_your_order'  # Second step of the checkout process
    ),
    # Products
    url(r'^products/$', ProductListView.as_view(), name='product_list'),
    url(r'^products/(?P<slug>[0-9A-Za-z-_.//]+)/$',