__str__ fuction
This commit is contained in:
@@ -410,6 +410,9 @@ class ProductVariant(DirtyFieldsMixin, models.Model):
|
|||||||
ShowCaseSlider, verbose_name='دسته بندی پورسانتی', blank=True, null=True, on_delete=models.CASCADE)
|
ShowCaseSlider, verbose_name='دسته بندی پورسانتی', blank=True, null=True, on_delete=models.CASCADE)
|
||||||
created_at = models.DateTimeField(
|
created_at = models.DateTimeField(
|
||||||
auto_now_add=True, verbose_name='زمان ثبت محصول')
|
auto_now_add=True, verbose_name='زمان ثبت محصول')
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return f"{self.product.name} - {', '.join(str(attr) for attr in self.product_attributes.all())}"
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = 'تنوع محصول'
|
verbose_name = 'تنوع محصول'
|
||||||
@@ -433,8 +436,6 @@ class ProductVariant(DirtyFieldsMixin, models.Model):
|
|||||||
name='variant_product_discount_idx'),
|
name='variant_product_discount_idx'),
|
||||||
]
|
]
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return f"{self.product.name} - {', '.join(str(attr) for attr in self.product_attributes.all())}"
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def price_before_discount(self):
|
def price_before_discount(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user