Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
4821 Prikazi

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
Opusti
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.

Avatar
Opusti
Avtor

Thank you

I have done it by write;

Related Posts Odgovori Prikazi Aktivnost
1
feb. 24
1910
3
mar. 20
21536
0
sep. 19
4517
1
apr. 18
11991
0
jul. 15
3821