ob-dj-store 0.0.17.7__py3-none-any.whl → 0.0.17.8__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.
@@ -463,7 +463,8 @@ class OrderSerializer(serializers.ModelSerializer):
463
463
  if gift_details:
464
464
  amount = gift_details["price"]
465
465
  else:
466
- amount = user.cart.total_price
466
+ amount = user.cart.full_price
467
+
467
468
  if wallet.balance < amount:
468
469
  raise serializers.ValidationError(
469
470
  {"wallet": _("Insufficient Funds")},
@@ -601,12 +602,14 @@ class ProductVariantSerializer(ArabicFieldsMixin, serializers.ModelSerializer):
601
602
  is_primary = serializers.SerializerMethodField()
602
603
  inventory = serializers.SerializerMethodField()
603
604
  name_extra = serializers.SerializerMethodField("get_name_extra")
605
+ label_extra = serializers.SerializerMethodField("get_label_extra")
604
606
 
605
607
  class Meta:
606
608
  model = ProductVariant
607
609
  fields = (
608
610
  "id",
609
611
  "name_extra",
612
+ "label_extra",
610
613
  "name",
611
614
  "label",
612
615
  "sku",
@@ -626,6 +629,9 @@ class ProductVariantSerializer(ArabicFieldsMixin, serializers.ModelSerializer):
626
629
  def get_name_extra(self, obj):
627
630
  return obj.name
628
631
 
632
+ def get_label_extra(self, obj):
633
+ return obj.label
634
+
629
635
  def get_is_primary(self, obj):
630
636
  return True if obj.inventories.filter(is_primary=True).exists() else False
631
637
 
@@ -1664,16 +1670,24 @@ class PartnerOTPRequestSerializer(serializers.ModelSerializer):
1664
1670
  return partner_otp_auth
1665
1671
 
1666
1672
 
1667
- class PartnerSerializer(serializers.ModelSerializer):
1673
+ class PartnerSerializer(ArabicFieldsMixin, serializers.ModelSerializer):
1668
1674
  discount = DiscountSerializer()
1669
1675
  stores = StoreListSerializer(many=True)
1670
1676
 
1671
1677
  class Meta:
1672
1678
  model = Partner
1673
- fields = ("id", "name", "stores", "auth_method", "country", "discount")
1679
+ fields = (
1680
+ "id",
1681
+ "name",
1682
+ "stores",
1683
+ "auth_method",
1684
+ "country",
1685
+ "discount",
1686
+ "name_arabic",
1687
+ )
1674
1688
 
1675
1689
 
1676
- class PartnerAuthInfoSerializer(serializers.ModelSerializer):
1690
+ class PartnerAuthInfoSerializer(ArabicFieldsMixin, serializers.ModelSerializer):
1677
1691
  partner = PartnerSerializer(read_only=True)
1678
1692
  promotion_code = serializers.IntegerField(write_only=True, required=False)
1679
1693
  otp_code = serializers.IntegerField(write_only=True, required=False)
@@ -770,7 +770,9 @@ class ProductView(
770
770
  def featured(self, request, *args, **kwargs):
771
771
  instance = self.get_queryset().filter(is_featured=True)
772
772
  page = self.paginate_queryset(instance)
773
- serializer = ProductListSerializer(page, many=True)
773
+ serializer = ProductListSerializer(
774
+ page, many=True, context={"request": request}
775
+ )
774
776
  return self.get_paginated_response(serializer.data)
775
777
 
776
778
 
@@ -6,7 +6,14 @@ from ob_dj_store.core.stores import models
6
6
  class OpeningHoursInlineAdmin(admin.TabularInline):
7
7
  model = models.OpeningHours
8
8
  extra = 1
9
- fields = ["store", "weekday", "from_hour", "to_hour", "always_open"]
9
+ fields = [
10
+ "store",
11
+ "weekday",
12
+ "weekday_arabic",
13
+ "from_hour",
14
+ "to_hour",
15
+ "always_open",
16
+ ]
10
17
 
11
18
  def get_queryset(self, request):
12
19
  return super().get_queryset(request).select_related("store")
@@ -0,0 +1,18 @@
1
+ # Generated by Django 3.2.8 on 2023-12-21 15:09
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ("stores", "0101_store_is_digital"),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AddField(
14
+ model_name="partner",
15
+ name="name_arabic",
16
+ field=models.CharField(blank=True, max_length=255, null=True),
17
+ ),
18
+ ]
@@ -44,6 +44,7 @@ class Partner(DjangoModelCleanMixin, models.Model):
44
44
  CODE = "CODE", _("Promotion code")
45
45
 
46
46
  name = models.CharField(_("Partner's Name"), max_length=255)
47
+ name_arabic = models.CharField(null=True, blank=True, max_length=255)
47
48
  stores = models.ManyToManyField(Store, related_name="partners")
48
49
  promotion_code = models.PositiveBigIntegerField(
49
50
  _("Promotion code"), null=True, blank=True, unique=True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ob-dj-store
3
- Version: 0.0.17.7
3
+ Version: 0.0.17.8
4
4
  Summary: OBytes django application for managing ecommerce stores.
5
5
  Home-page: https://www.obytes.com/
6
6
  Author: OBytes
@@ -2,8 +2,8 @@ ob_dj_store/apis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
2
2
  ob_dj_store/apis/stores/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  ob_dj_store/apis/stores/filters.py,sha256=zKBXPBoqIyFlSeZOECp97RTWvSLqNPnlPhEp7p8W5tE,9702
4
4
  ob_dj_store/apis/stores/urls.py,sha256=7vwogfIGcKS0hHYK3iBXKQwi1kCA_vuHY1eZt8rAspg,2021
5
- ob_dj_store/apis/stores/views.py,sha256=wcTVpGOuRvYc0ADnu6niHPy_jcWKTYUTX9cJ7UAOWfE,43320
6
- ob_dj_store/apis/stores/rest/serializers/serializers.py,sha256=_vGPkWaZs8Osq3xV9Dg9cgu9JMHPK02tfSxlvxBWBT0,61442
5
+ ob_dj_store/apis/stores/views.py,sha256=aE4LFPHzs_CtzZ8K5-vAbDn_51hyhi0KIsi7cV8dpkA,43372
6
+ ob_dj_store/apis/stores/rest/serializers/serializers.py,sha256=unQr5K3TA5X7MJmwrBkTKS7zP7Tovtm42F64CCSjjNY,61750
7
7
  ob_dj_store/apis/tap/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  ob_dj_store/apis/tap/serializers.py,sha256=KPrBK4h2-fWvEVf6vOj2ww5-USV9WqpyYicIqoHIiXI,1065
9
9
  ob_dj_store/apis/tap/urls.py,sha256=bnOTv6an11kxpo_FdqlhsizlGPLVpNxBjCyKcf3_C9M,367
@@ -11,7 +11,7 @@ ob_dj_store/apis/tap/views.py,sha256=VnVquybTHlJquxsC0RNTy20dtLXalchO0SlGjSDaBng
11
11
  ob_dj_store/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  ob_dj_store/core/stores/__init__.py,sha256=-izNGrxNn_nn3IQXd5pkuES9lSF-AHYb14yhNPozYCI,65
13
13
  ob_dj_store/core/stores/admin.py,sha256=5nudX9BJ4lF58gYjAI3bR0dnVDJ_GxP-p1tBjEaPFws,12487
14
- ob_dj_store/core/stores/admin_inlines.py,sha256=NM8Ab7htloQdihRBmew4Ie-ENsKhMlKRIsIH06xO1Mw,2903
14
+ ob_dj_store/core/stores/admin_inlines.py,sha256=2K8iDmP4h0CLIOqy3x-ZXXpgYnT2jqL4cg5YFdiho8s,2976
15
15
  ob_dj_store/core/stores/apps.py,sha256=ZadmEER_dNcQTH617b3fAsYZJSyRw0g46Kjp4eOAsOU,498
16
16
  ob_dj_store/core/stores/managers.py,sha256=Rhv_jTul29A0t_H7jiLQUewn4GnSbgYZ6kq4WAivvjc,9852
17
17
  ob_dj_store/core/stores/receivers.py,sha256=DljYC97C_e1mHduKw9Un6YQmxIdwSIter7yVVZwggFA,3768
@@ -134,6 +134,7 @@ ob_dj_store/core/stores/migrations/0098_alter_discount_discount_rate.py,sha256=J
134
134
  ob_dj_store/core/stores/migrations/0099_alter_product_name_arabic.py,sha256=dVv63A8f01zqA12KMWhV8Gu4brt8UYZ152TPk_aKiZw,483
135
135
  ob_dj_store/core/stores/migrations/0100_remove_shippingmethod_type_arabic.py,sha256=3rwZhXsOqbo4jdW6AT5ClaDqXPYbMfP1JOesNzy-Ldw,347
136
136
  ob_dj_store/core/stores/migrations/0101_store_is_digital.py,sha256=yDs7c23WLdhnx82VBw0Fs_YJ0-IgfxLMvMsCkIiThFU,404
137
+ ob_dj_store/core/stores/migrations/0102_partner_name_arabic.py,sha256=iJIiy5isLYv9Jv2sd-NOyZkwySNlXOEqGTOWE3wLH5w,411
137
138
  ob_dj_store/core/stores/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
138
139
  ob_dj_store/core/stores/models/__init__.py,sha256=VeWrDiIbw94ZDSFD-62rz9iTTW87iPdwDW5jcjxm7bs,2045
139
140
  ob_dj_store/core/stores/models/_address.py,sha256=8zV444A8M7P8yqQHjEOCROUykWPQ1ndSdd2IIX8wwWY,2207
@@ -142,7 +143,7 @@ ob_dj_store/core/stores/models/_favorite.py,sha256=3yyMCoiftGOPAQwkMI2J29r3x6NJs
142
143
  ob_dj_store/core/stores/models/_feedback.py,sha256=eCUVgprNK5hSRKOS4M_pdR7QH2-rqhoYevlpykhCOLg,1472
143
144
  ob_dj_store/core/stores/models/_inventory.py,sha256=ZU8xDMQZxLnFehkBEGWr-os4AF1IlCn5XnBxvRq9IAs,4314
144
145
  ob_dj_store/core/stores/models/_order.py,sha256=hFdlAQcN-iZM6_RaIWJ_FATwTER7pHCGoGSqc2prWBM,9710
145
- ob_dj_store/core/stores/models/_partner.py,sha256=n2D_tbhsry6QH3eFBMJyWTmv3Sd2iuKXBylIsjEU4fc,4470
146
+ ob_dj_store/core/stores/models/_partner.py,sha256=Rm7viyuJWGT2abZcqu1axmLvi7bdlfmgL1qd2gzshVA,4544
146
147
  ob_dj_store/core/stores/models/_payment.py,sha256=LLXDKDeetCWauybC_VCtxxnD1PECKvuzQcPrnTBh6fs,6434
147
148
  ob_dj_store/core/stores/models/_product.py,sha256=F4GPoYXxmw-LC8Gben7RRFly-NmnjcvQhT6hrDggKbw,17665
148
149
  ob_dj_store/core/stores/models/_store.py,sha256=PM5pPJL7-1FNKN7zmwJCkNqZs2cxlzg5HNxPGqpVwlc,9633
@@ -151,7 +152,7 @@ ob_dj_store/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
151
152
  ob_dj_store/utils/helpers.py,sha256=o7wgypM7mI2vZqZKkhxnTcnHJC8GMQDOuYMnRwXr6tY,2058
152
153
  ob_dj_store/utils/model.py,sha256=DV7hOhTaZL3gh9sptts2jTUFlTArKG3i7oPioq9HLFE,303
153
154
  ob_dj_store/utils/utils.py,sha256=8UVAFB56qUSjJJ5f9vnermtw638gdFy4CFRCuMbns_M,1342
154
- ob_dj_store-0.0.17.7.dist-info/METADATA,sha256=5vV7G_J3rAOIkCuAWMdrMvSgZgxZXJFeiODm9Pi1gBU,2827
155
- ob_dj_store-0.0.17.7.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
156
- ob_dj_store-0.0.17.7.dist-info/top_level.txt,sha256=CZG3G0ptTkzGnc0dFYN-ZD7YKdJBmm47bsmGwofD_lk,12
157
- ob_dj_store-0.0.17.7.dist-info/RECORD,,
155
+ ob_dj_store-0.0.17.8.dist-info/METADATA,sha256=mfkmpYXZgtcUSeoD_MZhvF2rxLCqEB5QH31KVwGmrgE,2827
156
+ ob_dj_store-0.0.17.8.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
157
+ ob_dj_store-0.0.17.8.dist-info/top_level.txt,sha256=CZG3G0ptTkzGnc0dFYN-ZD7YKdJBmm47bsmGwofD_lk,12
158
+ ob_dj_store-0.0.17.8.dist-info/RECORD,,