From ee2f413daa5c9df2425e0adc21362f5f1c9e1bb2 Mon Sep 17 00:00:00 2001 From: Max Yakovenko Date: Thu, 2 Aug 2018 23:42:08 +0300 Subject: [PATCH] bug fix --- products/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/products/models.py b/products/models.py index 6ca8f76..6e92e2d 100644 --- a/products/models.py +++ b/products/models.py @@ -75,6 +75,7 @@ class Manufacturer(AbstractStatusModel): name = models.CharField(max_length=64, blank=True, null=True, default=None) slug = AutoSlugField(populate_from='name') image = models.ImageField(upload_to='producers', blank=True, null=True, verbose_name=("Изображение")) + status = models.SmallIntegerField(_('статус'), default=STATUS_DEFAULT, choices=STATUS_CHOICES) def __str__(self): return self.name @@ -167,7 +168,7 @@ class ProductRate(AbstractDateTimeModel): class ProductDiscount(AbstractStatusModel): product = models.ForeignKey(Product, on_delete=models.CASCADE) percentage = models.DecimalField(_('процент'), max_digits=3, decimal_places=2) - status = models.BooleanField(_('статус'), choices=STATUS_CHOICES, default=STATUS_DEFAULT) + status = models.SmallIntegerField(_('статус'), choices=STATUS_CHOICES, default=STATUS_DEFAULT) class Meta: verbose_name = _('Дисконт') @@ -198,8 +199,7 @@ class ProductImage(AbstractStatusModel): }) product = models.ForeignKey(Product, on_delete=models.CASCADE) - status = models.SmallIntegerField(_('Статус'),choices=STATUS_CHOICES, default=STATUS_DEFAULT, - ) + status = models.SmallIntegerField(_('Статус'),choices=STATUS_CHOICES, default=STATUS_DEFAULT) filename = models.CharField(_('Имя файла'), max_length=255) image = models.FileField(_('Изображение'), upload_to=get_file_path, max_length=500) is_default = models.BooleanField(_('По умолчанию'), default=False)