Возможно ли добавить сохранение нескольких изображений в один столбец в mysql с помощью dajngo framework?
я новичок в этой области. в настоящее время я делаю сайт электронной коммерции, который продает samrtphone.
I want to add mulitple product images. In order to add the images do i need more columns for every image.
How to add mutiple ram and price for product. Samrtphone have mutiple ram according to ram price varies.user can choose ram of the product. How to add this in to my project using mysql. Do ineed more columns for every ram.
в вашем models.py добавьте,
...
images = models.ManyToManyField("Image", blank=True)
varieties = models.ManyToManyField("Variety", blank=True)
...
class Image(models.Model):
caption = models.CharField(max_length=100, blank=True)
file = models.ImageField(upload_to="product_images/")
class Variety(models.Model):
ram = models.CharField(max_length=100)
price = models.IntegerField()