Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
4802 Visualizações

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
Cancelar
Melhor resposta

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

Thank you

I have done it by write;

Publicações relacionadas Respostas Visualizações Atividade
1
fev. 24
1897
3
mar. 20
21521
0
set. 19
4513
1
abr. 18
11988
0
jul. 15
3817