예제 #1
0
    def post(self, request, *args, **kwargs):
        if request.is_ajax():

            cart = get_cart(request)
            cart_action = self._get_operation(request)
            item_pk = self._get_item(request)

            request.session[u'cart'] = self._do_operation(cart, cart_action, item_pk)

            return HttpResponse('Operation Success!')
        else:
            return HttpResponseForbidden()
예제 #2
0
    def post(self, request, *args, **kwargs):
        if request.is_ajax():

            cart = get_cart(request)
            cart_action = self._get_operation(request)
            item_pk = self._get_item(request)

            request.session[u'cart'] = self._do_operation(
                cart, cart_action, item_pk)

            return HttpResponse('Operation Success!')
        else:
            return HttpResponseForbidden()
예제 #3
0
    def get(self, request, *args, **kwargs):
        template_name = kwargs.get('template_name',
                                   settings.SHOPPING_CART_TEMPLATE)
        context = {u'cart': get_cart(request)}

        return render(request, template_name, context)
예제 #4
0
    def get(self, request, *args, **kwargs):
        template_name = kwargs.get('template_name', settings.SHOPPING_CART_TEMPLATE)
        context = {u'cart': get_cart(request)}

        return render(request, template_name, context)