ob-dj-store 0.0.17.3__py3-none-any.whl → 0.0.17.4__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.
@@ -108,7 +108,9 @@ class AttributeChoiceSerializer(ArabicFieldsMixin, serializers.ModelSerializer):
108
108
  fields = (
109
109
  "id",
110
110
  "name",
111
+ "name_arabic",
111
112
  "label",
113
+ "label_arabic",
112
114
  "is_default",
113
115
  )
114
116
 
@@ -137,6 +139,7 @@ class AttributeSerializer(ArabicFieldsMixin, serializers.ModelSerializer):
137
139
  fields = (
138
140
  "id",
139
141
  "name",
142
+ "name_arabic",
140
143
  "attribute_choices",
141
144
  )
142
145
 
@@ -552,6 +555,7 @@ class ProductTagSerializer(ArabicFieldsMixin, serializers.ModelSerializer):
552
555
  fields = (
553
556
  "id",
554
557
  "name",
558
+ "name_arabic",
555
559
  "text_color",
556
560
  "background_color",
557
561
  )
@@ -565,6 +569,7 @@ class ProductAttributeSerializer(ArabicFieldsMixin, serializers.ModelSerializer)
565
569
  fields = (
566
570
  "id",
567
571
  "name",
572
+ "name_arabic",
568
573
  "is_mandatory",
569
574
  "attribute_choices",
570
575
  "type",
@@ -578,13 +583,17 @@ class ProductVariantSerializer(ArabicFieldsMixin, serializers.ModelSerializer):
578
583
  product_attributes = ProductAttributeSerializer(many=True)
579
584
  is_primary = serializers.SerializerMethodField()
580
585
  inventory = serializers.SerializerMethodField()
586
+ name_extra = serializers.SerializerMethodField("get_name_extra")
581
587
 
582
588
  class Meta:
583
589
  model = ProductVariant
584
590
  fields = (
585
591
  "id",
592
+ "name_extra",
586
593
  "name",
594
+ "name_arabic",
587
595
  "label",
596
+ "label_arabic",
588
597
  "sku",
589
598
  "product_attributes",
590
599
  "is_primary",
@@ -596,6 +605,9 @@ class ProductVariantSerializer(ArabicFieldsMixin, serializers.ModelSerializer):
596
605
  )
597
606
  extra_kwargs = {"image_thumbnail_medium": {"read_only": True}}
598
607
 
608
+ def get_name_extra(self, obj):
609
+ return obj.name
610
+
599
611
  def get_is_primary(self, obj):
600
612
  return True if obj.inventories.filter(is_primary=True).exists() else False
601
613
 
@@ -822,6 +834,8 @@ class ProductSerializer(ArabicFieldsMixin, FavoriteMixin, serializers.ModelSeria
822
834
  "product_variants",
823
835
  "default_variant",
824
836
  "favorites",
837
+ "name_arabic",
838
+ "description_arabic",
825
839
  )
826
840
 
827
841
  def to_representation(self, instance: Product):
@@ -838,9 +852,12 @@ class ProductListSerializer(ArabicFieldsMixin, serializers.ModelSerializer):
838
852
  fields = (
839
853
  "id",
840
854
  "name",
855
+ "name_arabic",
841
856
  "slug",
842
857
  "label",
858
+ "label_arabic",
843
859
  "description",
860
+ "description_arabic",
844
861
  "product_images",
845
862
  "type",
846
863
  )
@@ -857,7 +874,9 @@ class SubCategorySerializer(serializers.ModelSerializer):
857
874
  fields = (
858
875
  "id",
859
876
  "name",
877
+ "name_arabic",
860
878
  "description",
879
+ "description_arabic",
861
880
  "is_active",
862
881
  "products",
863
882
  "image",
@@ -894,7 +913,9 @@ class CategorySerializer(ArabicFieldsMixin, serializers.ModelSerializer):
894
913
  fields = (
895
914
  "id",
896
915
  "name",
916
+ "name_arabic",
897
917
  "description",
918
+ "description_arabic",
898
919
  "products",
899
920
  "is_active",
900
921
  "subcategories",
@@ -1047,6 +1068,7 @@ class StoreSerializer(ArabicFieldsMixin, FavoriteMixin, serializers.ModelSeriali
1047
1068
  "current_day_opening_hours",
1048
1069
  "image",
1049
1070
  "busy_mode",
1071
+ "name_arabic",
1050
1072
  )
1051
1073
  extra_kwargs = {
1052
1074
  "image": {"read_only": True, "required": False},
@@ -1124,7 +1146,10 @@ class StoreSerializer(ArabicFieldsMixin, FavoriteMixin, serializers.ModelSeriali
1124
1146
  return len(self.favorites) > 0
1125
1147
 
1126
1148
  def get_address_line(self, obj):
1127
- return obj.address.address_line
1149
+ language = (
1150
+ True if self.context["request"].META.get("HTTP_LANGUAGE", "") else False
1151
+ )
1152
+ return obj.address.address_line_arabic if language else obj.address.address_line
1128
1153
 
1129
1154
  def get_distance(self, obj):
1130
1155
  # get the distance between the user location and store location
@@ -1167,7 +1192,9 @@ class PaymentMethodSerializer(ArabicFieldsMixin, serializers.ModelSerializer):
1167
1192
  "id",
1168
1193
  "payment_provider",
1169
1194
  "name",
1195
+ "name_arabic",
1170
1196
  "description",
1197
+ "description_arabic",
1171
1198
  )
1172
1199
 
1173
1200
 
@@ -1276,6 +1303,7 @@ class FavoriteSerializer(ArabicFieldsMixin, serializers.ModelSerializer):
1276
1303
  "extra_info",
1277
1304
  "object_type",
1278
1305
  "name",
1306
+ "name_arabic",
1279
1307
  "is_available_in_store",
1280
1308
  )
1281
1309
  extra_kwargs = {
@@ -1439,6 +1467,7 @@ class WalletSerializer(ArabicFieldsMixin, serializers.ModelSerializer):
1439
1467
  "currency",
1440
1468
  "balance",
1441
1469
  "name",
1470
+ "name_arabic",
1442
1471
  "media_image",
1443
1472
  "image_url",
1444
1473
  ]
@@ -0,0 +1,17 @@
1
+ # Generated by Django 3.2.8 on 2023-12-14 14:32
2
+
3
+ from django.db import migrations
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ("stores", "0099_alter_product_name_arabic"),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.RemoveField(
14
+ model_name="shippingmethod",
15
+ name="type_arabic",
16
+ ),
17
+ ]
@@ -29,11 +29,6 @@ class ShippingMethod(models.Model):
29
29
  TAKEAWAY = "TAKEAWAY"
30
30
  DELIVERY = "DELIVERY"
31
31
 
32
- class ShippingTypeArabic(models.TextChoices):
33
- DRIVE_THROUGH = "DRIVE_THROUGH"
34
- TAKEAWAY = "TAKEAWAY"
35
- DELIVERY = "توصيل"
36
-
37
32
  class ShippingFeeOptions(models.IntegerChoices):
38
33
  """
39
34
  Decides how the shipping fees should be calculated.
@@ -46,11 +41,6 @@ class ShippingMethod(models.Model):
46
41
  type = models.CharField(
47
42
  max_length=30, choices=ShippingType.choices, default=ShippingType.DELIVERY
48
43
  )
49
- type_arabic = models.CharField(
50
- max_length=30,
51
- choices=ShippingTypeArabic.choices,
52
- default=ShippingTypeArabic.DELIVERY,
53
- )
54
44
  shipping_fee_option = models.IntegerField(
55
45
  choices=ShippingFeeOptions.choices, default=1
56
46
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ob-dj-store
3
- Version: 0.0.17.3
3
+ Version: 0.0.17.4
4
4
  Summary: OBytes django application for managing ecommerce stores.
5
5
  Home-page: https://www.obytes.com/
6
6
  Author: OBytes
@@ -3,7 +3,7 @@ ob_dj_store/apis/stores/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
3
3
  ob_dj_store/apis/stores/filters.py,sha256=lrtmusSkMSQZMrn4PYbwWwqDtPbWQc-nOXE3Wdl58ew,9676
4
4
  ob_dj_store/apis/stores/urls.py,sha256=7vwogfIGcKS0hHYK3iBXKQwi1kCA_vuHY1eZt8rAspg,2021
5
5
  ob_dj_store/apis/stores/views.py,sha256=wcTVpGOuRvYc0ADnu6niHPy_jcWKTYUTX9cJ7UAOWfE,43320
6
- ob_dj_store/apis/stores/rest/serializers/serializers.py,sha256=if2fW9hSUU4JKJmcfestOCNfuCIzc06pPvUpQqZ9Pug,59639
6
+ ob_dj_store/apis/stores/rest/serializers/serializers.py,sha256=2UdqUOvqtX1IozbT619VkSbLv5y87Zz2qlyU6NKsP1k,60564
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
@@ -132,6 +132,7 @@ ob_dj_store/core/stores/migrations/0096_discount_discount_pos_id.py,sha256=UMK1y
132
132
  ob_dj_store/core/stores/migrations/0097_auto_20231108_1939.py,sha256=zlz85pUO_3TynWIVcJfWESoapuffdY4aed8FQXhOF1s,1177
133
133
  ob_dj_store/core/stores/migrations/0098_alter_discount_discount_rate.py,sha256=JkIwox2MiBxDtjvUZVHbF7zQZwL0JiejDglFf5lANGk,577
134
134
  ob_dj_store/core/stores/migrations/0099_alter_product_name_arabic.py,sha256=dVv63A8f01zqA12KMWhV8Gu4brt8UYZ152TPk_aKiZw,483
135
+ ob_dj_store/core/stores/migrations/0100_remove_shippingmethod_type_arabic.py,sha256=3rwZhXsOqbo4jdW6AT5ClaDqXPYbMfP1JOesNzy-Ldw,347
135
136
  ob_dj_store/core/stores/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
136
137
  ob_dj_store/core/stores/models/__init__.py,sha256=VeWrDiIbw94ZDSFD-62rz9iTTW87iPdwDW5jcjxm7bs,2045
137
138
  ob_dj_store/core/stores/models/_address.py,sha256=8zV444A8M7P8yqQHjEOCROUykWPQ1ndSdd2IIX8wwWY,2207
@@ -143,13 +144,13 @@ ob_dj_store/core/stores/models/_order.py,sha256=hFdlAQcN-iZM6_RaIWJ_FATwTER7pHCG
143
144
  ob_dj_store/core/stores/models/_partner.py,sha256=n2D_tbhsry6QH3eFBMJyWTmv3Sd2iuKXBylIsjEU4fc,4470
144
145
  ob_dj_store/core/stores/models/_payment.py,sha256=LLXDKDeetCWauybC_VCtxxnD1PECKvuzQcPrnTBh6fs,6434
145
146
  ob_dj_store/core/stores/models/_product.py,sha256=F4GPoYXxmw-LC8Gben7RRFly-NmnjcvQhT6hrDggKbw,17665
146
- ob_dj_store/core/stores/models/_store.py,sha256=LmCdnkhuxMPC3oDAUXDlPuiTey_SWhGSLUnrG_9IToY,9888
147
+ ob_dj_store/core/stores/models/_store.py,sha256=wv_bkWIpudUUcM81rLaOnuVzhBPMU5Dqk3oUmMY5Ep8,9581
147
148
  ob_dj_store/core/stores/models/_wallet.py,sha256=Eb1Sy79_M8PGrcfd5Bri0fT-bkwyqfkPHNyC2T7CR_0,5454
148
149
  ob_dj_store/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
149
150
  ob_dj_store/utils/helpers.py,sha256=o7wgypM7mI2vZqZKkhxnTcnHJC8GMQDOuYMnRwXr6tY,2058
150
151
  ob_dj_store/utils/model.py,sha256=DV7hOhTaZL3gh9sptts2jTUFlTArKG3i7oPioq9HLFE,303
151
152
  ob_dj_store/utils/utils.py,sha256=8UVAFB56qUSjJJ5f9vnermtw638gdFy4CFRCuMbns_M,1342
152
- ob_dj_store-0.0.17.3.dist-info/METADATA,sha256=iD1ucE15Y-3JN0n9W3izZsw-7B80hXDuMlUJCL6SwP4,2827
153
- ob_dj_store-0.0.17.3.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
154
- ob_dj_store-0.0.17.3.dist-info/top_level.txt,sha256=CZG3G0ptTkzGnc0dFYN-ZD7YKdJBmm47bsmGwofD_lk,12
155
- ob_dj_store-0.0.17.3.dist-info/RECORD,,
153
+ ob_dj_store-0.0.17.4.dist-info/METADATA,sha256=ntqmx3kziaao3jAf57faWXBgL8ZRc8i6Oc8VDMfxDNY,2827
154
+ ob_dj_store-0.0.17.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
155
+ ob_dj_store-0.0.17.4.dist-info/top_level.txt,sha256=CZG3G0ptTkzGnc0dFYN-ZD7YKdJBmm47bsmGwofD_lk,12
156
+ ob_dj_store-0.0.17.4.dist-info/RECORD,,