fix unisex stuff in shop

sync_v2
Raz 8 months ago
parent b9db62e761
commit d264179306
  1. 18
      shop/migrations/0025_alter_product_cut.py
  2. 3
      shop/models.py

@ -0,0 +1,18 @@
# Generated by Django 5.1 on 2025-03-27 17:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shop', '0024_coupon_order_discount_amount_order_coupon_and_more'),
]
operations = [
migrations.AlterField(
model_name='product',
name='cut',
field=models.IntegerField(choices=[(0, 'Unisex'), (1, 'Women'), (2, 'Men'), (3, 'Kids')], default=0),
),
]

@ -9,6 +9,7 @@ class OrderStatus(models.TextChoices):
CANCELED = 'CANCELED', 'Canceled'
class CutChoices(models.IntegerChoices):
UNISEX = 0, 'Unisex'
WOMEN = 1, 'Women'
MEN = 2, 'Men'
KIDS = 3, 'Kids'
@ -43,7 +44,7 @@ class Product(models.Model):
colors = models.ManyToManyField("shop.Color", blank=True, related_name="products")
sizes = models.ManyToManyField("shop.Size", blank=True, related_name="products")
ordering_value = models.IntegerField(default=0, blank=False)
cut = models.IntegerField(choices=CutChoices.choices, default=CutChoices.MEN)
cut = models.IntegerField(choices=CutChoices.choices, default=CutChoices.UNISEX)
class Meta:
ordering = ['ordering_value', 'cut'] # Add this line to sort by title

Loading…
Cancel
Save