add image field to sub category model
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.1.2 on 2025-01-28 17:48
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('product', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='subcategorymodel',
|
||||
old_name='icon',
|
||||
new_name='image',
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,23 @@
|
||||
# Generated by Django 5.1.2 on 2025-01-28 17:49
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('product', '0002_rename_icon_subcategorymodel_image'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='subcategorymodel',
|
||||
name='icon',
|
||||
field=models.ImageField(blank=True, null=True, upload_to='category_model/', verbose_name='آیکون'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='subcategorymodel',
|
||||
name='image',
|
||||
field=models.ImageField(blank=True, null=True, upload_to='category_model/', verbose_name='عکس'),
|
||||
),
|
||||
]
|
||||
@@ -26,6 +26,7 @@ class MainCategoryModel(models.Model):
|
||||
class SubCategoryModel(models.Model):
|
||||
name = models.CharField(max_length=50, verbose_name='نام')
|
||||
slug = models.SlugField(max_length=50, unique=True, help_text="اسم دسته را برای مسیر به انگلیسی و بدون فاصله وارد کنید")
|
||||
image = models.ImageField(upload_to='category_model/',verbose_name='عکس', blank=True, null=True)
|
||||
icon = models.ImageField(upload_to='category_model/',verbose_name='آیکون', blank=True, null=True)
|
||||
meta_title = models.CharField(max_length=60, verbose_name="عنوان متا", help_text="عنوان متا برای SEO", blank=True, null=True)
|
||||
meta_description = models.TextField(max_length=160, verbose_name="توضیحات متا", help_text="توضیحات متا برای SEO", blank=True, null=True)
|
||||
|
||||
Reference in New Issue
Block a user