Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
4933 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Auteur

Thank you

I have done it by write;

Gerelateerde posts Antwoorden Weergaven Activiteit
1
feb. 24
2126
3
mrt. 20
21678
0
sep. 19
4622
1
apr. 18
12103
0
jul. 15
3928