Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Replaced partitioner method with satchless Partitioner
Artur Smęt2c239d66843b
diff --git a/saleor/cart/__init__.py b/saleor/cart/__init__.pyindex f31cec863c..cdd9876461 100755--- a/saleor/cart/__init__.py+++ b/saleor/cart/__init__.py@@ -3,7 +3,7 @@ from __future__ import unicode_literalsfrom django.utils.translation import pgettextfrom django.utils.encoding import python_2_unicode_compatiblefrom satchless import cart-from satchless.item import ItemList, partition+from satchless.item import ItemListclass DigitalGroup(ItemList):@@ -25,8 +25,4 @@ class Cart(cart.Cart):def __str__(self):return pgettext('Shopping cart',- 'Your cart (%(cart_count)s)') % {'cart_count': self.count()}---def partitioner(subject):- return partition(subject, lambda product: 'shippable')\ No newline at end of file+ 'Your cart (%(cart_count)s)') % {'cart_count': self.count()}\ No newline at end of filediff --git a/saleor/cart/views.py b/saleor/cart/views.pyindex 579b927f31..77aaa27098 100755--- a/saleor/cart/views.py+++ b/saleor/cart/views.py@@ -4,13 +4,13 @@ from django.contrib import messagesfrom django.shortcuts import redirectfrom django.template.response import TemplateResponsefrom django.utils.translation import ugettext as _+from satchless.item import Partitionerfrom .forms import ReplaceCartLineFormSet-from . import partitionerdef index(request):- cart_partitioner = partitioner(request.cart)+ cart_partitioner = Partitioner(request.cart)formset = ReplaceCartLineFormSet(request.POST or None, cart=request.cart)if formset.is_valid():msg = _('Successfully updated product quantities.')diff --git a/saleor/checkout/__init__.py b/saleor/checkout/__init__.pyindex 05b7ee0439..956167da31 100644--- a/saleor/checkout/__init__.py+++ b/saleor/checkout/__init__.py@@ -3,10 +3,11 @@ from collections import defaultdictfrom django.conf import settingsfrom prices import Pricefrom satchless.process import ProcessManager+from satchless.item import Partitionerfrom .steps import (BillingAddressStep, ShippingStep, DigitalDeliveryStep,SummaryStep)-from ..cart import DigitalGroup, partitioner+from ..cart import DigitalGroupfrom ..core import analyticsfrom ..order.models import Order@@ -41,7 +42,7 @@ class Checkout(ProcessManager):self.generate_steps(request.cart)def generate_steps(self, cart):- self.items = partitioner(cart)+ self.items = Partitioner(cart)self.billing = BillingAddressStep(self.request, self.get_storage('billing'))self.steps.append(self.billing)