Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4708 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Autore

Thank you

I have done it by write;

Post correlati Risposte Visualizzazioni Attività
1
feb 24
1821
3
mar 20
21444
0
set 19
4484
1
apr 18
11900
0
lug 15
3744