Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4805 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

hello vx2008 ,

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

Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you

I have done it by write;

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 2 24
1897
3
thg 3 20
21522
0
thg 9 19
4515
1
thg 4 18
11988
0
thg 7 15
3817