Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
4815 Vistas

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
Mejor respuesta

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;

Publicaciones relacionadas Respuestas Vistas Actividad
1
feb 24
1906
3
mar 20
21530
0
sept 19
4516
1
abr 18
11990
0
jul 15
3820