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

Hi All,

I have created module where employee can upload their image. Module works perfectly. No issue with saving /displaying employee record including image.

But I would like to know where exactly image file is stored ?

Thanks. Here is my class and img field holds file name. Please let me know in which table image is stored and how it is related to test_base table ?

from osv import osv

from osv import fields

class test_base(osv.osv):
     _name='test.base'
    _columns={
        'name':fields.char('Name'),
        'email':fields.char('Email'),
        'mydate':fields.date('My Date'),
        'code':fields.integer('Unique ID'),
        'sal':fields.integer('Salary'),
        'rate':fields.selection([(10,'10'), (20,'20'),(30,'30')],'Percentage of Deduction'),
        'ded':fields.float('Deduction'),
        'bdisplay':fields.float('Net Salary'),
        'image': fields.binary("Image", help="Select image here"),
        'skillid':fields.one2many('test.skill','exp'),

    }
الصورة الرمزية
إهمال
أفضل إجابة

Hello shrikant

Image is stored in binary format. Go to pgadmin or access your database on terminal.

select image from test_base; The image column will show you binary format string for each image

الصورة الرمزية
إهمال

thanks for the info. Does it mean that we can't view image stored in database?

No u cannot view image because its just binary format data.

Thanks Again.

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
سبتمبر 23
7736
2
مارس 23
46828
2
ديسمبر 23
57751
0
مارس 22
2416
3
يونيو 20
10716