示例#1
0
    def write(self, cr, uid, ids, vals, context=None):
        if vals.get('image',False):
            s3 = s3client(self)
            image_url=s3.upload(cr,uid,vals.get('image'),vals.get('file_name','image.png'))
            vals['image_url']=image_url

        return super(born_content, self).write(cr, uid, ids, vals, context=context)
示例#2
0
    def create(self, cr, uid, vals, context=None):
        if context is None:
            context = {}
        if vals.get('image',False):

            s3 =s3client(self)
            image_url=s3.upload(cr,uid,vals.get('image'),vals.get('file_name','image.png'))
            vals['image_url']=image_url

        #本地保存
        return super(born_content, self).create(cr, uid, vals, context=context)
示例#3
0
    def write(self, cr, uid, ids, vals, context=None):
        if vals.get('image', False):
            s3 = s3client(self)
            image_url = s3.upload(cr, uid, vals.get('image'),
                                  vals.get('file_name', 'image.png'))
            vals['image_url'] = image_url

        return super(born_content, self).write(cr,
                                               uid,
                                               ids,
                                               vals,
                                               context=context)
示例#4
0
    def create(self, cr, uid, vals, context=None):
        if context is None:
            context = {}
        if vals.get('image', False):

            s3 = s3client(self)
            image_url = s3.upload(cr, uid, vals.get('image'),
                                  vals.get('file_name', 'image.png'))
            vals['image_url'] = image_url

        #本地保存
        return super(born_content, self).create(cr, uid, vals, context=context)