From d26417930674f7420819f6424d0ae9a3a19f061c Mon Sep 17 00:00:00 2001 From: Raz Date: Thu, 27 Mar 2025 18:37:05 +0100 Subject: [PATCH] fix unisex stuff in shop --- shop/migrations/0025_alter_product_cut.py | 18 ++++++++++++++++++ shop/models.py | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 shop/migrations/0025_alter_product_cut.py diff --git a/shop/migrations/0025_alter_product_cut.py b/shop/migrations/0025_alter_product_cut.py new file mode 100644 index 0000000..3c68b31 --- /dev/null +++ b/shop/migrations/0025_alter_product_cut.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), + ), + ] diff --git a/shop/models.py b/shop/models.py index ebbf7dc..14f64ed 100644 --- a/shop/models.py +++ b/shop/models.py @@ -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