udpate product detail name filed

This commit is contained in:
Parsa Nazer
2025-04-22 03:09:07 +03:30
parent 5d17038f9b
commit 044bed9c00
4 changed files with 29 additions and 4 deletions
+2 -1
View File
@@ -213,6 +213,7 @@ class ProductImageModel(models.Model):
class ProductDetailModel(models.Model):
name = models.CharField(max_length=50, verbose_name='نام جزيیات', help_text='این متن فقط برای راحتی در استفاده از پنل ادمین میباشد')
detail_category = models.ForeignKey(ProductDetailCategory, on_delete=models.CASCADE, verbose_name='دسته بندی جزيات')
detail = models.ManyToManyField(DetailModel, verbose_name='جزيات ها')
@@ -220,7 +221,7 @@ class ProductDetailModel(models.Model):
verbose_name = 'جزیات محصول'
verbose_name_plural = 'جزیات محصول ها'
def __str__(self):
return f'جزيیات محصول {self.detail_category.title}'
return f'جزيیات محصول {self.detail_category.title} - {self.name}'
class ProductVariant(models.Model):
product = models.ForeignKey(ProductModel, on_delete=models.CASCADE, related_name='variants', verbose_name='محصول')