diff --git a/backend/product/models.py b/backend/product/models.py index 27f242a..4799ea1 100644 --- a/backend/product/models.py +++ b/backend/product/models.py @@ -410,6 +410,9 @@ class ProductVariant(DirtyFieldsMixin, models.Model): ShowCaseSlider, verbose_name='دسته بندی پورسانتی', blank=True, null=True, on_delete=models.CASCADE) 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 = 'تنوع محصول' @@ -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):