콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4808 화면

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
1899
3
3월 20
21523
0
9월 19
4515
1
4월 18
11990
0
7월 15
3818