[英]__init__() got an unexpected keyword argument 'save' - django python
I am trying to save image to ImageField 我正在尝试将图像保存到ImageField
location = Location()
image = Image()
name = urlparse(url).path.split('/')[-1]
image.bild.save(name, File(urllib2.urlopen(url).read(), save=False))
image.von_location = location
image.save()
but I am getting 但我越来越
__init__() got an unexpected keyword argument 'save'
why is this? 为什么是这样? what am i doing wrong here?
我在这里做错了什么?
The File
constructor doesn't take a save
argument. File
构造函数不使用save
参数。 Perhaps you mean to pass it to image.bild.save()
instead. 也许您的意思是将其传递给
image.bild.save()
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.