__str__ fuction
This commit is contained in:
@@ -411,6 +411,9 @@ class ProductVariant(DirtyFieldsMixin, models.Model):
|
||||
created_at = models.DateTimeField(
|
||||
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:
|
||||
verbose_name = 'تنوع محصول'
|
||||
verbose_name_plural = 'تنوعهای محصول'
|
||||
@@ -433,8 +436,6 @@ class ProductVariant(DirtyFieldsMixin, models.Model):
|
||||
name='variant_product_discount_idx'),
|
||||
]
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.product.name} - {', '.join(str(attr) for attr in self.product_attributes.all())}"
|
||||
|
||||
@property
|
||||
def price_before_discount(self):
|
||||
|
||||
Reference in New Issue
Block a user