diff --git a/memberportal/api_shop/migrations/0003_product_qty_in_stock.py b/memberportal/api_shop/migrations/0003_product_qty_in_stock.py new file mode 100644 index 00000000..443a5a1f --- /dev/null +++ b/memberportal/api_shop/migrations/0003_product_qty_in_stock.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.22 on 2023-11-18 20:19 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("api_shop", "0002_auto_20231119_0615"), + ] + + operations = [ + migrations.AddField( + model_name="product", + name="qty_in_stock", + field=models.IntegerField(default=0), + preserve_default=False, + ), + ] diff --git a/memberportal/api_shop/migrations/0004_alter_product_qty_in_stock.py b/memberportal/api_shop/migrations/0004_alter_product_qty_in_stock.py new file mode 100644 index 00000000..94f71676 --- /dev/null +++ b/memberportal/api_shop/migrations/0004_alter_product_qty_in_stock.py @@ -0,0 +1,17 @@ +# Generated by Django 3.2.22 on 2023-11-18 20:19 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("api_shop", "0003_product_qty_in_stock"), + ] + + operations = [ + migrations.AlterField( + model_name="product", + name="qty_in_stock", + field=models.IntegerField(default=0), + ), + ] diff --git a/memberportal/api_shop/models.py b/memberportal/api_shop/models.py index a20decb5..b7388831 100644 --- a/memberportal/api_shop/models.py +++ b/memberportal/api_shop/models.py @@ -26,6 +26,7 @@ class Product(models.Model): buy_price = models.DecimalField(max_digits=6, decimal_places=2) sell_price = models.DecimalField(max_digits=6, decimal_places=2) memberbucks_only = models.BooleanField(default=True) + qty_in_stock = models.IntegerField(default=0) def __str__(self): return f"{{ self.name }} - {{ self.description }} - {{ self.sell_price }}"