![](/img/trans.png)
[英]__init__() got an unexpected keyword argument 'mime' in python/django
[英]__init__() got an unexpected keyword argument 'save' - django python
我正在尝试将图像保存到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()
但我越来越
__init__() got an unexpected keyword argument 'save'
为什么是这样? 我在这里做错了什么?
File
构造函数不使用save
参数。 也许您的意思是将其传递给image.bild.save()
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.