繁体   English   中英

__init __()获得了意外的关键字参数'save'-Django Python

[英]__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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM