Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Assign shipment to country
Mira Szewczykdb54158ce88c
diff --git a/saleor/shipping/utils.py b/saleor/shipping/utils.pynew file mode 100644index 0000000000..0798b69400--- /dev/null+++ b/saleor/shipping/utils.py@@ -0,0 +1,9 @@+from .models import ShippingMethodCountry, COUNTRY_CODE_CHOICES+++def assign_shipment_to_country():+ shippments = {}+ for code in COUNTRY_CODE_CHOICES:+ shippments[code[0]] = ShippingMethodCountry.objects.select_related(+ 'shipping_method').filter(country_code=code)+ return shippments