ob-dj-store 0.0.20.3__py3-none-any.whl → 0.0.20.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.
- ob_dj_store/apis/stores/rest/serializers/serializers.py +13 -18
- ob_dj_store/core/stores/admin.py +0 -1
- ob_dj_store/core/stores/admin_inlines.py +1 -0
- ob_dj_store/core/stores/migrations/0107_auto_20250425_2059.py +29 -0
- ob_dj_store/core/stores/models/_order.py +2 -1
- ob_dj_store/core/stores/models/_product.py +1 -1
- ob_dj_store/core/stores/models/_store.py +2 -2
- {ob_dj_store-0.0.20.3.dist-info → ob_dj_store-0.0.20.4.dist-info}/METADATA +3 -2
- {ob_dj_store-0.0.20.3.dist-info → ob_dj_store-0.0.20.4.dist-info}/RECORD +11 -10
- {ob_dj_store-0.0.20.3.dist-info → ob_dj_store-0.0.20.4.dist-info}/WHEEL +1 -1
- {ob_dj_store-0.0.20.3.dist-info → ob_dj_store-0.0.20.4.dist-info}/top_level.txt +0 -0
@@ -416,13 +416,9 @@ class OrderSerializer(serializers.ModelSerializer):
|
|
416
416
|
logger.info(
|
417
417
|
f"The fix for UAE stores timezone failed due to this error {e}"
|
418
418
|
)
|
419
|
-
if
|
420
|
-
|
421
|
-
|
422
|
-
_("Pickup time must be between store's opening hours")
|
423
|
-
)
|
424
|
-
elif (
|
425
|
-
not op_hour.always_open
|
419
|
+
if (
|
420
|
+
op_hour.is_open_after_midnight
|
421
|
+
and not op_hour.always_open
|
426
422
|
and pickup_time_time > to_hour
|
427
423
|
or pickup_time_time < from_hour
|
428
424
|
):
|
@@ -1169,7 +1165,6 @@ class StoreSerializer(ArabicFieldsMixin, FavoriteMixin, serializers.ModelSeriali
|
|
1169
1165
|
"image",
|
1170
1166
|
"busy_mode",
|
1171
1167
|
"name_arabic",
|
1172
|
-
"is_open_after_midnight",
|
1173
1168
|
)
|
1174
1169
|
extra_kwargs = {
|
1175
1170
|
"image": {"read_only": True, "required": False},
|
@@ -1183,16 +1178,16 @@ class StoreSerializer(ArabicFieldsMixin, FavoriteMixin, serializers.ModelSeriali
|
|
1183
1178
|
if current_op_hour:
|
1184
1179
|
from_hour = current_op_hour.from_hour
|
1185
1180
|
to_hour = current_op_hour.to_hour
|
1186
|
-
if current_time.tzinfo.zone != "Asia/Dubai":
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
if
|
1181
|
+
# if current_time.tzinfo.zone != "Asia/Dubai":
|
1182
|
+
# if obj.currency == "AED":
|
1183
|
+
# try:
|
1184
|
+
# current_time += timedelta(hours=1)
|
1185
|
+
# except Exception as e:
|
1186
|
+
# logger.info(
|
1187
|
+
# f"The fix for UAE stores timezone failed due to this error {e}"
|
1188
|
+
# )
|
1189
|
+
|
1190
|
+
if current_op_hour.is_open_after_midnight:
|
1196
1191
|
return True if to_hour < current_time.time() < from_hour else False
|
1197
1192
|
|
1198
1193
|
if current_op_hour.always_open:
|
ob_dj_store/core/stores/admin.py
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Generated by Django 3.2.8 on 2025-04-25 17:59
|
2
|
+
|
3
|
+
from django.db import migrations, models
|
4
|
+
|
5
|
+
|
6
|
+
class Migration(migrations.Migration):
|
7
|
+
|
8
|
+
dependencies = [
|
9
|
+
("stores", "0106_alter_paymentmethod_payment_provider"),
|
10
|
+
]
|
11
|
+
|
12
|
+
operations = [
|
13
|
+
migrations.RemoveField(model_name="store", name="is_open_after_midnight",),
|
14
|
+
migrations.AddField(
|
15
|
+
model_name="openinghours",
|
16
|
+
name="is_open_after_midnight",
|
17
|
+
field=models.BooleanField(default=False),
|
18
|
+
),
|
19
|
+
migrations.AddField(
|
20
|
+
model_name="order",
|
21
|
+
name="offer_id",
|
22
|
+
field=models.IntegerField(blank=True, default=None, null=True),
|
23
|
+
),
|
24
|
+
migrations.AddField(
|
25
|
+
model_name="order",
|
26
|
+
name="offer_redeemed",
|
27
|
+
field=models.BooleanField(default=False),
|
28
|
+
),
|
29
|
+
]
|
@@ -90,7 +90,8 @@ class Order(DjangoModelCleanMixin, models.Model):
|
|
90
90
|
# Pick up can be now or a later hour during the day. If pickup_time is not set,
|
91
91
|
extra_infos = models.JSONField(null=True, blank=True,)
|
92
92
|
init_data = models.JSONField(null=True, blank=True)
|
93
|
-
|
93
|
+
offer_redeemed = models.BooleanField(default=False)
|
94
|
+
offer_id = models.IntegerField(null=True, blank=True, default=None)
|
94
95
|
# TODO: add pick_up_time maybe ?
|
95
96
|
# audit fields
|
96
97
|
created_at = models.DateTimeField(auto_now_add=True)
|
@@ -141,7 +141,7 @@ class AvailabilityHours(DjangoModelCleanMixin, models.Model):
|
|
141
141
|
def clean(self) -> None:
|
142
142
|
super().clean()
|
143
143
|
try:
|
144
|
-
if self.store.is_open_after_midnight:
|
144
|
+
if self.store.current_opening_hours.is_open_after_midnight:
|
145
145
|
return
|
146
146
|
except Exception as e:
|
147
147
|
logger.info(f"OpeningHours has no store: {e}")
|
@@ -179,7 +179,6 @@ class Store(DjangoModelCleanMixin, models.Model):
|
|
179
179
|
)
|
180
180
|
busy_mode = models.BooleanField(default=False)
|
181
181
|
is_digital = models.BooleanField(default=False)
|
182
|
-
is_open_after_midnight = models.BooleanField(default=False)
|
183
182
|
created_at = models.DateTimeField(auto_now_add=True)
|
184
183
|
updated_at = models.DateTimeField(auto_now=True)
|
185
184
|
|
@@ -238,6 +237,7 @@ class OpeningHours(DjangoModelCleanMixin, models.Model):
|
|
238
237
|
created_at = models.DateTimeField(auto_now_add=True)
|
239
238
|
updated_at = models.DateTimeField(auto_now=True)
|
240
239
|
always_open = models.BooleanField(default=False)
|
240
|
+
is_open_after_midnight = models.BooleanField(default=False)
|
241
241
|
|
242
242
|
class Meta:
|
243
243
|
ordering = ("weekday", "from_hour")
|
@@ -252,7 +252,7 @@ class OpeningHours(DjangoModelCleanMixin, models.Model):
|
|
252
252
|
def clean(self) -> None:
|
253
253
|
super().clean()
|
254
254
|
try:
|
255
|
-
if self.store
|
255
|
+
if self.store:
|
256
256
|
return
|
257
257
|
except Exception as e:
|
258
258
|
logger.info(f"OpeningHours has no store: {e}")
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: ob-dj-store
|
3
|
-
Version: 0.0.20.
|
3
|
+
Version: 0.0.20.4
|
4
4
|
Summary: OBytes django application for managing ecommerce stores.
|
5
5
|
Home-page: https://www.obytes.com/
|
6
6
|
Author: OBytes
|
@@ -25,6 +25,7 @@ Requires-Dist: djangorestframework-gis
|
|
25
25
|
Requires-Dist: django-filter
|
26
26
|
Requires-Dist: django-leaflet
|
27
27
|
Requires-Dist: django-countries
|
28
|
+
Dynamic: requires-dist
|
28
29
|
|
29
30
|
## OBytes Django Store App
|
30
31
|
|
@@ -3,15 +3,15 @@ ob_dj_store/apis/stores/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
|
|
3
3
|
ob_dj_store/apis/stores/filters.py,sha256=kbKtrg9ba9R5ptN9xOOEo-ZZ2IZbQfGH6BJCGUzF1bc,9510
|
4
4
|
ob_dj_store/apis/stores/urls.py,sha256=7vwogfIGcKS0hHYK3iBXKQwi1kCA_vuHY1eZt8rAspg,2021
|
5
5
|
ob_dj_store/apis/stores/views.py,sha256=P8hkpMxC080QlPGFXaQXV2wKoo-B0aUg-hToHtMG24s,41612
|
6
|
-
ob_dj_store/apis/stores/rest/serializers/serializers.py,sha256
|
6
|
+
ob_dj_store/apis/stores/rest/serializers/serializers.py,sha256=vfCqxP3PqbV9Kni75W30HHEx0ro3_5O3sHgQ3pnUnlU,65704
|
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=sWqNT3nnEFXwRlVokoZREpCOwMQtyd_ZzrvUtQ6c5L0,2620
|
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=
|
14
|
-
ob_dj_store/core/stores/admin_inlines.py,sha256=
|
13
|
+
ob_dj_store/core/stores/admin.py,sha256=aI1t3nIeOw_Vcy2E2LNaAxMRX2GjvVrVeBaH-n4IHco,14362
|
14
|
+
ob_dj_store/core/stores/admin_inlines.py,sha256=9_35VwwRh5w8YU2CRTJ7sENUjF-D-J-o9jXhLEPpS3w,2900
|
15
15
|
ob_dj_store/core/stores/apps.py,sha256=ZadmEER_dNcQTH617b3fAsYZJSyRw0g46Kjp4eOAsOU,498
|
16
16
|
ob_dj_store/core/stores/managers.py,sha256=4vdWqnfOuTbBgLiPt0yyF4TFzYFzzgLJgRT3iKGWqhk,9877
|
17
17
|
ob_dj_store/core/stores/receivers.py,sha256=vduxOB9M6IgQ8E7dYrbC4T0PjOqLCgAVi2PwElTzNhM,3676
|
@@ -139,6 +139,7 @@ ob_dj_store/core/stores/migrations/0103_alter_paymentmethod_payment_provider.py,
|
|
139
139
|
ob_dj_store/core/stores/migrations/0104_wallettransaction_is_redeemed.py,sha256=1AFAvPFR2G3zwrJoilpdNVUk3xp8jwAxc2a8WQEXc3g,420
|
140
140
|
ob_dj_store/core/stores/migrations/0105_store_is_open_after_midnight.py,sha256=8EXutaPuUQjk94hAduLFoYVxPkPLMNCdD8TTmUdqfZ8,412
|
141
141
|
ob_dj_store/core/stores/migrations/0106_alter_paymentmethod_payment_provider.py,sha256=BDDfVs0fMifUnSlZ4zIct78F6PvfP5gyrVFyifrCvE4,1092
|
142
|
+
ob_dj_store/core/stores/migrations/0107_auto_20250425_2059.py,sha256=XCj2Inlw8e-_6W9wvYeVVV-bGk6lX8_n2FNI5W80XVw,848
|
142
143
|
ob_dj_store/core/stores/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
143
144
|
ob_dj_store/core/stores/models/__init__.py,sha256=VeWrDiIbw94ZDSFD-62rz9iTTW87iPdwDW5jcjxm7bs,2045
|
144
145
|
ob_dj_store/core/stores/models/_address.py,sha256=uf9W4dnlXkEFhhsK75ZsDwWq5R2JEngf7VhBiLEnIVs,2193
|
@@ -146,17 +147,17 @@ ob_dj_store/core/stores/models/_cart.py,sha256=PVyjkJ0qfq9LGOd_LxnVFaG_g5AyKJGSa
|
|
146
147
|
ob_dj_store/core/stores/models/_favorite.py,sha256=3yyMCoiftGOPAQwkMI2J29r3x6NJsRYri9f8gXiF1e8,3306
|
147
148
|
ob_dj_store/core/stores/models/_feedback.py,sha256=5kQ_AD9nkY57UOKo_qHg4_nEQAdFjK4VZjZ_R88q33Q,1456
|
148
149
|
ob_dj_store/core/stores/models/_inventory.py,sha256=_rGlVL5HjOlHQVB8CI0776CPcE5r6szv1w3PjtkYnWM,4306
|
149
|
-
ob_dj_store/core/stores/models/_order.py,sha256=
|
150
|
+
ob_dj_store/core/stores/models/_order.py,sha256=_08lqX5p4brCdUilqfbT--6Ao2TMsqnzXaWoV_7IYL8,9758
|
150
151
|
ob_dj_store/core/stores/models/_partner.py,sha256=OuYvevUWn1sYHs9PcFf51EUUC1uqytQss8Bx91aMOH8,4732
|
151
152
|
ob_dj_store/core/stores/models/_payment.py,sha256=FTV-NmvQjxwwR5C5X7qYWV-ZUIZfqMMEjkBNaS-drLs,6421
|
152
|
-
ob_dj_store/core/stores/models/_product.py,sha256=
|
153
|
-
ob_dj_store/core/stores/models/_store.py,sha256=
|
153
|
+
ob_dj_store/core/stores/models/_product.py,sha256=E_P0BfJ5A7-aSb_8graCLOL_7PmL1JiBgqwx-mQpiM0,17825
|
154
|
+
ob_dj_store/core/stores/models/_store.py,sha256=0K-CNJWuXNqeyULL1J0M9hiNcVla0UNNjdCdN_nzNEE,9833
|
154
155
|
ob_dj_store/core/stores/models/_wallet.py,sha256=_qVNn2T0p-IIp4duiRSXLZ1hs9MeOnFrFabSghMWNgw,5341
|
155
156
|
ob_dj_store/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
156
157
|
ob_dj_store/utils/helpers.py,sha256=o7wgypM7mI2vZqZKkhxnTcnHJC8GMQDOuYMnRwXr6tY,2058
|
157
158
|
ob_dj_store/utils/model.py,sha256=DV7hOhTaZL3gh9sptts2jTUFlTArKG3i7oPioq9HLFE,303
|
158
159
|
ob_dj_store/utils/utils.py,sha256=8UVAFB56qUSjJJ5f9vnermtw638gdFy4CFRCuMbns_M,1342
|
159
|
-
ob_dj_store-0.0.20.
|
160
|
-
ob_dj_store-0.0.20.
|
161
|
-
ob_dj_store-0.0.20.
|
162
|
-
ob_dj_store-0.0.20.
|
160
|
+
ob_dj_store-0.0.20.4.dist-info/METADATA,sha256=4gnf7Q1ZGFLZY2FT8Og3ORtWZi1DXGZ0VvsrhwzlpOE,2850
|
161
|
+
ob_dj_store-0.0.20.4.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
|
162
|
+
ob_dj_store-0.0.20.4.dist-info/top_level.txt,sha256=CZG3G0ptTkzGnc0dFYN-ZD7YKdJBmm47bsmGwofD_lk,12
|
163
|
+
ob_dj_store-0.0.20.4.dist-info/RECORD,,
|
File without changes
|