Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
4715 Представления

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