From 25294edb49714588a3333221306a45d1aa1f9db3 Mon Sep 17 00:00:00 2001 From: Parsa Nazer Date: Sun, 26 Jan 2025 20:43:10 +0330 Subject: [PATCH] image123 --- ...del_image1_productmodel_image2_and_more.py | 28 +++++++++++++++++++ backend/product/models.py | 4 ++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 backend/product/migrations/0002_rename_image_productmodel_image1_productmodel_image2_and_more.py diff --git a/backend/product/migrations/0002_rename_image_productmodel_image1_productmodel_image2_and_more.py b/backend/product/migrations/0002_rename_image_productmodel_image1_productmodel_image2_and_more.py new file mode 100644 index 0000000..bec08bd --- /dev/null +++ b/backend/product/migrations/0002_rename_image_productmodel_image1_productmodel_image2_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 5.1.2 on 2025-01-26 17:12 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('product', '0001_initial'), + ] + + operations = [ + migrations.RenameField( + model_name='productmodel', + old_name='image', + new_name='image1', + ), + migrations.AddField( + model_name='productmodel', + name='image2', + field=models.ImageField(blank=True, null=True, upload_to='product_images/'), + ), + migrations.AddField( + model_name='productmodel', + name='image3', + field=models.ImageField(blank=True, null=True, upload_to='product_images/'), + ), + ] diff --git a/backend/product/models.py b/backend/product/models.py index 62c02a4..9cae4b0 100644 --- a/backend/product/models.py +++ b/backend/product/models.py @@ -75,7 +75,9 @@ class ProductModel(models.Model): ('derham', 'درهم') ) currency = models.CharField(verbose_name='نوع ارز', max_length=20, choices=currency_type) - image = models.ImageField(upload_to='product_images/') + image1 = models.ImageField(upload_to='product_images/') + image2 = models.ImageField(upload_to='product_images/', blank=True, null=True) + image3 = models.ImageField(upload_to='product_images/', blank=True, null=True) rating = models.PositiveIntegerField(default=0) view = models.IntegerField(default=0, verbose_name='بازدید') sell = models.IntegerField(default=0, verbose_name='فروش')