ob-dj-store 0.0.20.2__py3-none-any.whl → 0.0.20.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ob_dj_store/apis/stores/filters.py +5 -19
- ob_dj_store/apis/stores/rest/serializers/serializers.py +7 -16
- ob_dj_store/apis/stores/views.py +74 -226
- ob_dj_store/apis/tap/views.py +2 -6
- ob_dj_store/core/stores/admin.py +3 -20
- ob_dj_store/core/stores/admin_inlines.py +1 -7
- ob_dj_store/core/stores/gateway/tap/admin.py +1 -3
- ob_dj_store/core/stores/gateway/tap/managers.py +1 -6
- ob_dj_store/core/stores/gateway/tap/migrations/0001_initial.py +1 -3
- ob_dj_store/core/stores/gateway/tap/models.py +3 -12
- ob_dj_store/core/stores/gateway/tap/utils.py +2 -7
- ob_dj_store/core/stores/managers.py +1 -3
- ob_dj_store/core/stores/migrations/0001_initial.py +1 -4
- ob_dj_store/core/stores/migrations/0005_auto_20220425_2119.py +2 -5
- ob_dj_store/core/stores/migrations/0005_auto_20220427_1729.py +1 -2
- ob_dj_store/core/stores/migrations/0006_auto_20220428_0100.py +2 -8
- ob_dj_store/core/stores/migrations/0007_cart_cartitem_order_orderitem.py +2 -8
- ob_dj_store/core/stores/migrations/0010_auto_20220509_1633.py +1 -4
- ob_dj_store/core/stores/migrations/0012_auto_20220514_0633.py +1 -4
- ob_dj_store/core/stores/migrations/0013_auto_20220518_1539.py +1 -4
- ob_dj_store/core/stores/migrations/0014_auto_20220519_0018.py +3 -12
- ob_dj_store/core/stores/migrations/0017_auto_20220524_0912.py +3 -10
- ob_dj_store/core/stores/migrations/0018_auto_20220524_1613.py +1 -3
- ob_dj_store/core/stores/migrations/0021_auto_20220531_1849.py +1 -4
- ob_dj_store/core/stores/migrations/0026_auto_20220630_1913.py +8 -32
- ob_dj_store/core/stores/migrations/0031_auto_20220811_1733.py +1 -4
- ob_dj_store/core/stores/migrations/0033_auto_20220815_0133.py +2 -8
- ob_dj_store/core/stores/migrations/0039_auto_20220831_1521.py +1 -4
- ob_dj_store/core/stores/migrations/0044_remove_productvariant_has_inventory.py +1 -4
- ob_dj_store/core/stores/migrations/0049_auto_20221029_1524.py +2 -8
- ob_dj_store/core/stores/migrations/0050_favoriteextra.py +1 -3
- ob_dj_store/core/stores/migrations/0052_auto_20221129_1732.py +2 -8
- ob_dj_store/core/stores/migrations/0059_auto_20230217_2006.py +2 -8
- ob_dj_store/core/stores/migrations/0062_auto_20230226_2005.py +2 -6
- ob_dj_store/core/stores/migrations/0064_auto_20230228_1814.py +1 -2
- ob_dj_store/core/stores/migrations/0066_auto_20230304_1532.py +2 -8
- ob_dj_store/core/stores/migrations/0070_auto_20230323_1628.py +1 -4
- ob_dj_store/core/stores/migrations/0071_auto_20230328_1825.py +2 -5
- ob_dj_store/core/stores/migrations/0082_auto_20230613_1424.py +1 -4
- ob_dj_store/core/stores/migrations/0084_payment_result.py +1 -3
- ob_dj_store/core/stores/migrations/0087_auto_20230828_2138.py +1 -4
- ob_dj_store/core/stores/migrations/0097_auto_20231108_1939.py +1 -4
- ob_dj_store/core/stores/migrations/0100_remove_shippingmethod_type_arabic.py +1 -4
- ob_dj_store/core/stores/migrations/0106_alter_paymentmethod_payment_provider.py +35 -0
- ob_dj_store/core/stores/models/_address.py +1 -3
- ob_dj_store/core/stores/models/_cart.py +1 -3
- ob_dj_store/core/stores/models/_feedback.py +1 -3
- ob_dj_store/core/stores/models/_inventory.py +1 -2
- ob_dj_store/core/stores/models/_order.py +5 -19
- ob_dj_store/core/stores/models/_payment.py +3 -12
- ob_dj_store/core/stores/models/_product.py +4 -16
- ob_dj_store/core/stores/models/_store.py +3 -11
- ob_dj_store/core/stores/models/_wallet.py +7 -23
- ob_dj_store/core/stores/receivers.py +7 -20
- ob_dj_store/core/stores/utils.py +1 -2
- {ob_dj_store-0.0.20.2.dist-info → ob_dj_store-0.0.20.3.dist-info}/METADATA +1 -1
- {ob_dj_store-0.0.20.2.dist-info → ob_dj_store-0.0.20.3.dist-info}/RECORD +59 -58
- {ob_dj_store-0.0.20.2.dist-info → ob_dj_store-0.0.20.3.dist-info}/WHEEL +1 -1
- {ob_dj_store-0.0.20.2.dist-info → ob_dj_store-0.0.20.3.dist-info}/top_level.txt +0 -0
@@ -49,11 +49,7 @@ class StoreFilter(filters.FilterSet):
|
|
49
49
|
return queryset.filter(address__country=value)
|
50
50
|
|
51
51
|
def by_shipping_methods_names(self, queryset, name, value):
|
52
|
-
return queryset.filter(
|
53
|
-
shipping_methods__name__in=[
|
54
|
-
value,
|
55
|
-
]
|
56
|
-
)
|
52
|
+
return queryset.filter(shipping_methods__name__in=[value,])
|
57
53
|
|
58
54
|
def by_open_stores(self, queryset, name, value):
|
59
55
|
if value:
|
@@ -186,9 +182,7 @@ class CategoryFilter(filters.FilterSet):
|
|
186
182
|
|
187
183
|
def by_type(self, queryset, name, value):
|
188
184
|
return (
|
189
|
-
queryset.filter(
|
190
|
-
subcategories__products__type=value,
|
191
|
-
)
|
185
|
+
queryset.filter(subcategories__products__type=value,)
|
192
186
|
.prefetch_related(
|
193
187
|
Prefetch(
|
194
188
|
"subcategories",
|
@@ -198,9 +192,7 @@ class CategoryFilter(filters.FilterSet):
|
|
198
192
|
),
|
199
193
|
Prefetch(
|
200
194
|
"subcategories__products",
|
201
|
-
queryset=Product.objects.filter(
|
202
|
-
is_active=True,
|
203
|
-
).distinct(),
|
195
|
+
queryset=Product.objects.filter(is_active=True,).distinct(),
|
204
196
|
),
|
205
197
|
)
|
206
198
|
.distinct()
|
@@ -241,10 +233,7 @@ class FavoriteFilter(filters.FilterSet):
|
|
241
233
|
product_variants__inventories__store__pk=value
|
242
234
|
).values_list("id", flat=True)
|
243
235
|
content_type = ContentType.objects.get_for_model(Product)
|
244
|
-
return queryset.filter(
|
245
|
-
content_type=content_type,
|
246
|
-
object_id__in=products_ids,
|
247
|
-
)
|
236
|
+
return queryset.filter(content_type=content_type, object_id__in=products_ids,)
|
248
237
|
|
249
238
|
|
250
239
|
class PaymentMethodFilter(filters.FilterSet):
|
@@ -267,10 +256,7 @@ class PaymentMethodFilter(filters.FilterSet):
|
|
267
256
|
|
268
257
|
class WalletFilter(filters.FilterSet):
|
269
258
|
currency = filters.CharFilter(
|
270
|
-
method="by_currency",
|
271
|
-
validators=[
|
272
|
-
validate_currency,
|
273
|
-
],
|
259
|
+
method="by_currency", validators=[validate_currency,],
|
274
260
|
)
|
275
261
|
country = filters.CharFilter(method="by_country")
|
276
262
|
|
@@ -329,8 +329,7 @@ class OrderSerializer(serializers.ModelSerializer):
|
|
329
329
|
return store
|
330
330
|
|
331
331
|
def _validate_user_address(
|
332
|
-
self,
|
333
|
-
attrs,
|
332
|
+
self, attrs,
|
334
333
|
):
|
335
334
|
if "shipping_address" not in attrs:
|
336
335
|
raise ValidationError(
|
@@ -736,9 +735,7 @@ class CartItemSerializer(
|
|
736
735
|
"is_multi_variant",
|
737
736
|
)
|
738
737
|
extra_kwargs = {
|
739
|
-
"store": {
|
740
|
-
"required": True,
|
741
|
-
},
|
738
|
+
"store": {"required": True,},
|
742
739
|
}
|
743
740
|
|
744
741
|
def get_is_multi_variant(self, obj):
|
@@ -779,9 +776,9 @@ class CartItemSerializer(
|
|
779
776
|
favorites = Favorite.objects.favorites_for_object(
|
780
777
|
obj.product_variant.product, user
|
781
778
|
)
|
782
|
-
customization = [
|
783
|
-
obj.
|
784
|
-
]
|
779
|
+
customization = [obj.product_variant,] + [
|
780
|
+
attribute_choice for attribute_choice in obj.attribute_choices.all()
|
781
|
+
]
|
785
782
|
for favorite in favorites:
|
786
783
|
content_objects = [
|
787
784
|
instance.content_object for instance in favorite.extras.all()
|
@@ -1817,9 +1814,7 @@ class PartnerAuthInfoSerializer(ArabicFieldsMixin, serializers.ModelSerializer):
|
|
1817
1814
|
status=OneTruePairing.Statuses.init,
|
1818
1815
|
created_at__gte=timeout,
|
1819
1816
|
).get(
|
1820
|
-
email=attrs["email"],
|
1821
|
-
partner_otp_auth__partner=partner,
|
1822
|
-
user=user,
|
1817
|
+
email=attrs["email"], partner_otp_auth__partner=partner, user=user,
|
1823
1818
|
)
|
1824
1819
|
self.context["otp"] = otp
|
1825
1820
|
except ObjectDoesNotExist as e:
|
@@ -1856,11 +1851,7 @@ class PartnerAuthInfoSerializer(ArabicFieldsMixin, serializers.ModelSerializer):
|
|
1856
1851
|
otp.status = OneTruePairing.Statuses.used
|
1857
1852
|
otp.save()
|
1858
1853
|
partner_auth_info = PartnerAuthInfo.objects.update_or_create(
|
1859
|
-
user=user,
|
1860
|
-
defaults={
|
1861
|
-
"partner": partner,
|
1862
|
-
"email": validated_data["email"],
|
1863
|
-
},
|
1854
|
+
user=user, defaults={"partner": partner, "email": validated_data["email"],},
|
1864
1855
|
)
|
1865
1856
|
return partner_auth_info
|
1866
1857
|
|