Skip to Content
Menú
This question has been flagged
1 Respondre
4643 Vistes

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
Descartar
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
Descartar
Autor

Thank you

I have done it by write;

Related Posts Respostes Vistes Activitat
1
de febr. 24
1761
3
de març 20
21390
0
de set. 19
4461
1
d’abr. 18
11852
0
de jul. 15
3718