Help

0

how to upload a figure onto "fields.Binary()" by python codes?

Avatar
vx2008

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?

Avatar
Discard
1 Answer
1
Avatar
yousif Mobark
Best Answer

hello vx2008 ,

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

1 Comment
Avatar
Discard
Avatar
vx2008
-

Thank you

I have done it by write;