跳至内容
菜单
此问题已终结
1 回复
4660 查看

in .py file:

picture=fields.Binary(u'Picture')


in .xml file

<field name="picture" widget="image"/>


Now I want to upload a picture('~/1.png') onto "picutre" by python code;

I have tried: self.picuture='~/1.png', but failed; how should I do it correctly?

形象
丢弃
最佳答案

hello vx2008 ,

you don't have to deal with the upload code the default API method (create ,write,ect ..) will do it for you.

形象
丢弃
编写者

Thank you

I have done it by write;

相关帖文 回复 查看 活动
1
2月 24
1786
3
3月 20
21403
0
9月 19
4470
1
4月 18
11871
0
7月 15
3723