我想发表大量帖子。问题在于每个项目都需要一张图像(甚至可能只有几张)。是否可以通过批量请求做到这一点?
该模型:
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"
我可以使用批量请求发布多张图片,还是应该回复到单个帖子?
白衣染霜花
MYYA
相关分类