跳至內容
選單
此問題已被標幟
1 回覆
4822 瀏覽次數

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
1910
3
3月 20
21538
0
9月 19
4517
1
4月 18
11992
0
7月 15
3821