ProductDetailModel debug and ticket migrations push
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# Generated by Django 5.1.2 on 2025-04-21 23:30
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('product', '0035_alter_attributetype_options_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='productdetailmodel',
|
||||
name='detail_category',
|
||||
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='product.productdetailcategory', verbose_name='دسته بندی جزيات'),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
||||
@@ -213,14 +213,14 @@ class ProductImageModel(models.Model):
|
||||
|
||||
|
||||
class ProductDetailModel(models.Model):
|
||||
detail_category = models.ForeignKey(ProductDetailCategory, on_delete=models.CASCADE, verbose_name='دسته بندی جزيات', blank=True, null=True)
|
||||
detail_category = models.ForeignKey(ProductDetailCategory, on_delete=models.CASCADE, verbose_name='دسته بندی جزيات')
|
||||
detail = models.ManyToManyField(DetailModel, verbose_name='جزيات ها')
|
||||
|
||||
class Meta:
|
||||
verbose_name = 'جزیات محصول'
|
||||
verbose_name_plural = 'جزیات محصول ها'
|
||||
def __str__(self):
|
||||
return f'جزيیات محصول {self.detail_category.title} - {self.detail.title}'
|
||||
return f'جزيیات محصول {self.detail_category.title}'
|
||||
|
||||
class ProductVariant(models.Model):
|
||||
product = models.ForeignKey(ProductModel, on_delete=models.CASCADE, related_name='variants', verbose_name='محصول')
|
||||
|
||||
Reference in New Issue
Block a user