from django.db import models
from imagekit.models import ImageSpecField
from imagekit.processors import ResizeToFill
class Product(models.Model):
class Meta():
db_table = 'tovar'
product_title = models.CharField(max_length=200)
product_img = models.ImageField(upload_to='images')
avatar = models.ImageField(upload_to='avatars')
avatar_thumbnail = ImageSpecField(source='avatar',processors=[ResizeToFill(100, 50)],format='JPEG',options={'quality': 60})
product_categories = models.ForeignKey(Category)
product_subcategories = models.ForeignKey(Subcategory)
product_description = models.TextField()
def __unicode__(self):
return self.product_title
profile = Product.objects.all()[0]
print(profile.avatar_thumbnail.url)
print(profile.avatar_thumbnail.width)
Dont working manage.py syncdb
Error:
django.db.utils.OperationalError: no such table: tovar
pls healp me