Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4679 Widoki

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?

Awatar
Odrzuć
Najlepsza odpowiedź

hello vx2008 ,

you don't have to deal with the upload code the default API method (create ,write,ect ..) will do it for you.

Awatar
Odrzuć
Autor

Thank you

I have done it by write;

Powiązane posty Odpowiedzi Widoki Czynność
1
lut 24
1788
3
mar 20
21411
0
wrz 19
4471
1
kwi 18
11873
0
lip 15
3724