ob-dj-store 0.0.17.2__py3-none-any.whl → 0.0.17.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/rest/serializers/serializers.py +14 -13
- ob_dj_store/core/stores/admin.py +1 -0
- {ob_dj_store-0.0.17.2.dist-info → ob_dj_store-0.0.17.3.dist-info}/METADATA +1 -1
- {ob_dj_store-0.0.17.2.dist-info → ob_dj_store-0.0.17.3.dist-info}/RECORD +6 -6
- {ob_dj_store-0.0.17.2.dist-info → ob_dj_store-0.0.17.3.dist-info}/WHEEL +0 -0
- {ob_dj_store-0.0.17.2.dist-info → ob_dj_store-0.0.17.3.dist-info}/top_level.txt +0 -0
@@ -84,21 +84,22 @@ class ArabicFieldsMixin:
|
|
84
84
|
language_header = request.META.get("HTTP_LANGUAGE", "").upper()
|
85
85
|
return language_header == self.ARABIC_LANGUAGE_CODE
|
86
86
|
|
87
|
-
def
|
88
|
-
"""
|
89
|
-
Override the get_fields method to include or exclude Arabic fields.
|
90
|
-
"""
|
91
|
-
fields = super().get_fields()
|
87
|
+
def to_representation(self, instance):
|
92
88
|
request = self.context.get("request")
|
93
|
-
|
89
|
+
data = super().to_representation(instance)
|
94
90
|
if request and self.should_include_arabic_fields(request):
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
91
|
+
data_output = {}
|
92
|
+
for field_name, field_instance in data.items():
|
93
|
+
for suffix in self.arabic_field_suffixes:
|
94
|
+
if field_name.endswith(suffix) or field_name.startswith(suffix):
|
95
|
+
original_field_name = field_name.replace(suffix, "")
|
96
|
+
data_output[original_field_name] = (
|
97
|
+
field_instance
|
98
|
+
if field_instance
|
99
|
+
else data[original_field_name]
|
100
|
+
)
|
101
|
+
data.update(data_output)
|
102
|
+
return data
|
102
103
|
|
103
104
|
|
104
105
|
class AttributeChoiceSerializer(ArabicFieldsMixin, serializers.ModelSerializer):
|
ob_dj_store/core/stores/admin.py
CHANGED
@@ -3,14 +3,14 @@ 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=
|
6
|
+
ob_dj_store/apis/stores/rest/serializers/serializers.py,sha256=if2fW9hSUU4JKJmcfestOCNfuCIzc06pPvUpQqZ9Pug,59639
|
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
|
10
10
|
ob_dj_store/apis/tap/views.py,sha256=VnVquybTHlJquxsC0RNTy20dtLXalchO0SlGjSDaBng,2666
|
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
|
-
ob_dj_store/core/stores/admin.py,sha256=
|
13
|
+
ob_dj_store/core/stores/admin.py,sha256=VqTSIviohiX0OO39zr2HwZYFdxMWwV-mWdCYrbNc1IU,12322
|
14
14
|
ob_dj_store/core/stores/admin_inlines.py,sha256=NM8Ab7htloQdihRBmew4Ie-ENsKhMlKRIsIH06xO1Mw,2903
|
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
|
@@ -149,7 +149,7 @@ ob_dj_store/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
|
|
149
149
|
ob_dj_store/utils/helpers.py,sha256=o7wgypM7mI2vZqZKkhxnTcnHJC8GMQDOuYMnRwXr6tY,2058
|
150
150
|
ob_dj_store/utils/model.py,sha256=DV7hOhTaZL3gh9sptts2jTUFlTArKG3i7oPioq9HLFE,303
|
151
151
|
ob_dj_store/utils/utils.py,sha256=8UVAFB56qUSjJJ5f9vnermtw638gdFy4CFRCuMbns_M,1342
|
152
|
-
ob_dj_store-0.0.17.
|
153
|
-
ob_dj_store-0.0.17.
|
154
|
-
ob_dj_store-0.0.17.
|
155
|
-
ob_dj_store-0.0.17.
|
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,,
|
File without changes
|
File without changes
|