تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
4799 أدوات العرض

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;

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
فبراير 24
1897
3
مارس 20
21519
0
سبتمبر 19
4513
1
أبريل 18
11984
0
يوليو 15
3815