コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
4813 ビュー

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
1906
3
3月 20
21527
0
9月 19
4516
1
4月 18
11990
0
7月 15
3820