我想做一个批量的帖子。问题是每个项目都需要一个图像(或者甚至可能几个)。是否可以通过批量请求来做到这一点?
该模型:
class CollageItem(models.Model):
url = models.URLField(null = True)
image = models.FileField(upload_to = 'i')
thumbnail = models.FileField(upload_to = 't')
和 TastyPie 对象:
class CollageItemResource(ModelResource):
image = fields.FileField(attribute = 'image', null = True, blank = true)
thumbnail = fields.FileField(attribute = 'thumbnail', null = True, blank = true)
class Meta:
queryset = CollageItem.objects.all(
resource_name = "collage_item"
我可以使用批量请求发布多张图片还是应该恢复到单个帖子?