Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
4812 Näkymät

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
Hylkää
Paras vastaus

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
Hylkää
Tekijä

Thank you

I have done it by write;

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
helmik. 24
1904
3
maalisk. 20
21525
0
syysk. 19
4516
1
huhtik. 18
11990
0
heinäk. 15
3819