我有这个model.py文件但是在django admin我无法上传图片...我如何为每个产品上传多个图片? (1对多关系)
Models.py
TYPE = (('small', 'small'), ('medium', 'medium'), ('big', 'big'))
class Products(models.Model):
name = models.CharField(max_length=50)
category = models.CharField(max_length=50, choices=TYPE)
description = models.TextField()
def __unicode__(self):
return self.name
class Gallery(models.Model):
image_name = models.TextField()
image_up = models.ImageField(upload_to='prodotti/')
product = models.ForeignKey(Products)
def __unicode__(self):
return self.image_name