Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
4714 Переглядів

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?

Аватар
Відмінити
Найкраща відповідь

hello vx2008 ,

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

Аватар
Відмінити
Автор

Thank you

I have done it by write;

Related Posts Відповіді Переглядів Дія
1
лют. 24
1824
3
бер. 20
21451
0
вер. 19
4484
1
квіт. 18
11904
0
лип. 15
3744