ob-dj-store 0.0.21__py3-none-any.whl → 0.0.21.1__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.
@@ -87,6 +87,7 @@ class ProductFilter(filters.FilterSet):
87
87
  """Product filters"""
88
88
 
89
89
  category = filters.CharFilter(method="by_category")
90
+ q = filters.CharFilter(method="filter_search")
90
91
 
91
92
  class Meta:
92
93
  model = Product
@@ -99,6 +100,12 @@ class ProductFilter(filters.FilterSet):
99
100
  def by_category(self, queryset, name, value):
100
101
  return queryset.filter(category__name__iexact=value)
101
102
 
103
+ def filter_search(self, queryset, name, value):
104
+ print("q filter :", value)
105
+ return queryset.filter(
106
+ Q(name__icontains=value) | Q(description__icontains=value)
107
+ ).distinct()[:5]
108
+
102
109
 
103
110
  class VariantFilter(filters.FilterSet):
104
111
  """Variant filters"""
@@ -0,0 +1,27 @@
1
+ # Generated by Django 3.2.8 on 2025-07-31 16:12
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ("stores", "0108_alter_paymentmethod_payment_provider"),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AddField(
14
+ model_name="wallettransaction",
15
+ name="cashback_type",
16
+ field=models.CharField(
17
+ blank=True,
18
+ choices=[
19
+ ("BY_ORDER", "By Order"),
20
+ ("BY_OFFER", "By Offer"),
21
+ ("BY_STREAK", "By Streak"),
22
+ ],
23
+ max_length=100,
24
+ null=True,
25
+ ),
26
+ ),
27
+ ]
@@ -136,6 +136,11 @@ class WalletTransaction(models.Model):
136
136
  CREDIT = "CREDIT", _("credit")
137
137
  DEBIT = "DEBIT", _("debit")
138
138
 
139
+ class CashBackType(models.TextChoices):
140
+ BY_ORDER = "BY_ORDER", _("By Order")
141
+ BY_OFFER = "BY_OFFER", _("By Offer")
142
+ BY_STREAK = "BY_STREAK", _("By Streak")
143
+
139
144
  wallet = models.ForeignKey(
140
145
  "stores.Wallet", on_delete=models.CASCADE, related_name="transactions",
141
146
  )
@@ -150,7 +155,9 @@ class WalletTransaction(models.Model):
150
155
  is_cashback = models.BooleanField(default=False)
151
156
  is_refund = models.BooleanField(default=False)
152
157
  is_redeemed = models.BooleanField(default=False)
153
-
158
+ cashback_type = models.CharField(
159
+ max_length=100, choices=CashBackType.choices, blank=True, null=True
160
+ )
154
161
  objects = WalletTransactionManager()
155
162
 
156
163
  # Audit
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ob-dj-store
3
- Version: 0.0.21
3
+ Version: 0.0.21.1
4
4
  Summary: OBytes django application for managing ecommerce stores.
5
5
  Home-page: https://www.obytes.com/
6
6
  Author: OBytes
@@ -1,6 +1,6 @@
1
1
  ob_dj_store/apis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  ob_dj_store/apis/stores/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- ob_dj_store/apis/stores/filters.py,sha256=lDb-wS7dEsSS0XL2qN4XqoRKYSEDgxhVZLBPGL0pPM4,9764
3
+ ob_dj_store/apis/stores/filters.py,sha256=SzGLbiRhR3XEgAYcSI-_75xcq5GIA-yqLyBifY1yeBA,10031
4
4
  ob_dj_store/apis/stores/urls.py,sha256=7vwogfIGcKS0hHYK3iBXKQwi1kCA_vuHY1eZt8rAspg,2021
5
5
  ob_dj_store/apis/stores/views.py,sha256=YCYZ3XlJLFOwhpqMU-Lvx_emJwW-0fdyEF2SXROEmNU,41405
6
6
  ob_dj_store/apis/stores/rest/serializers/serializers.py,sha256=mhUS1LmnZpFY5OAnGbiMBwD6zywC7tZ8vKK1bVniJTE,67087
@@ -142,6 +142,7 @@ ob_dj_store/core/stores/migrations/0105_store_is_open_after_midnight.py,sha256=8
142
142
  ob_dj_store/core/stores/migrations/0106_alter_paymentmethod_payment_provider.py,sha256=BDDfVs0fMifUnSlZ4zIct78F6PvfP5gyrVFyifrCvE4,1092
143
143
  ob_dj_store/core/stores/migrations/0107_auto_20250425_2059.py,sha256=XCj2Inlw8e-_6W9wvYeVVV-bGk6lX8_n2FNI5W80XVw,848
144
144
  ob_dj_store/core/stores/migrations/0108_alter_paymentmethod_payment_provider.py,sha256=abuqKAhuha8tEdxJy-Tj1RNFOMV63_z5v_qK5LLSNVI,1078
145
+ ob_dj_store/core/stores/migrations/0109_wallettransaction_cashback_type.py,sha256=XA_RtxLjnpsz-i0uKlCyYK-UWL4RR10Q_XeqVd3KX6A,691
145
146
  ob_dj_store/core/stores/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
146
147
  ob_dj_store/core/stores/models/__init__.py,sha256=VeWrDiIbw94ZDSFD-62rz9iTTW87iPdwDW5jcjxm7bs,2045
147
148
  ob_dj_store/core/stores/models/_address.py,sha256=uf9W4dnlXkEFhhsK75ZsDwWq5R2JEngf7VhBiLEnIVs,2193
@@ -154,12 +155,12 @@ ob_dj_store/core/stores/models/_partner.py,sha256=OuYvevUWn1sYHs9PcFf51EUUC1uqyt
154
155
  ob_dj_store/core/stores/models/_payment.py,sha256=FTV-NmvQjxwwR5C5X7qYWV-ZUIZfqMMEjkBNaS-drLs,6421
155
156
  ob_dj_store/core/stores/models/_product.py,sha256=E_P0BfJ5A7-aSb_8graCLOL_7PmL1JiBgqwx-mQpiM0,17825
156
157
  ob_dj_store/core/stores/models/_store.py,sha256=0K-CNJWuXNqeyULL1J0M9hiNcVla0UNNjdCdN_nzNEE,9833
157
- ob_dj_store/core/stores/models/_wallet.py,sha256=_qVNn2T0p-IIp4duiRSXLZ1hs9MeOnFrFabSghMWNgw,5341
158
+ ob_dj_store/core/stores/models/_wallet.py,sha256=YvT-rvED-jrYjePLJpvdLXXoBudR6TGPu5cNE0m2fWo,5643
158
159
  ob_dj_store/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
159
160
  ob_dj_store/utils/helpers.py,sha256=o7wgypM7mI2vZqZKkhxnTcnHJC8GMQDOuYMnRwXr6tY,2058
160
161
  ob_dj_store/utils/model.py,sha256=DV7hOhTaZL3gh9sptts2jTUFlTArKG3i7oPioq9HLFE,303
161
162
  ob_dj_store/utils/utils.py,sha256=8UVAFB56qUSjJJ5f9vnermtw638gdFy4CFRCuMbns_M,1342
162
- ob_dj_store-0.0.21.dist-info/METADATA,sha256=nNHhaaoDX74DIVkXI3-7yGfjgene_TVIED1B8dx0bxo,2848
163
- ob_dj_store-0.0.21.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
164
- ob_dj_store-0.0.21.dist-info/top_level.txt,sha256=CZG3G0ptTkzGnc0dFYN-ZD7YKdJBmm47bsmGwofD_lk,12
165
- ob_dj_store-0.0.21.dist-info/RECORD,,
163
+ ob_dj_store-0.0.21.1.dist-info/METADATA,sha256=tJ38YD5gc0-K0XNtvVbgpPre75gQc0wUWnG6tr-JjDs,2850
164
+ ob_dj_store-0.0.21.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
165
+ ob_dj_store-0.0.21.1.dist-info/top_level.txt,sha256=CZG3G0ptTkzGnc0dFYN-ZD7YKdJBmm47bsmGwofD_lk,12
166
+ ob_dj_store-0.0.21.1.dist-info/RECORD,,