如何转换' Postgresql' biginteger在python中输入整数?

时间:2015-08-18 11:20:24

标签: python postgresql odoo odoo-8

这是我的方法:

def onchange_book_limit(self, cr, uid, ids, partner_id, context=None)   
    if partner_id:
       cr.execute(""" select count(*) from rmkbook_issue where retflag!= 1 and partner_id = %s """ %(partner_id))
       cnt=cr.fetchone()
       cnt1=integer(cnt[0])
       if(cnt1 > 3):
           cr.execute("""insert into testwizard(orderid1) values(%s)""" %(cnt1))
           raise osv.except_osv(_('Error!'), _('Sorry...You have exceeds the limit to take a book....!'))

    return partner_id

0 个答案:

没有答案