我想从终端上的 new_all 获取数据库的结果,但它显示喜欢这个
[(无,无,你',0,无,无,无,u'1000',无),(u'test',u'',u'',801,> u'2014 -09-05',无,无,u'10010000',1),“......
如何将其转换为中文以了解 new_all 的含义。 我的终端如图所示。 数据库是msSQL,odoo没关系。
# -*- coding: utf-8 -*-
from openerp import models, fields, api, _
from openerp.exceptions import UserError
import logging
logger = logging.getLogger(__name__)
import pymssql
class service_sync_wizard(models.TransientModel):
_name = 'service.sync.wizard'
@api.multi
def service_sync(self):
logger.debug('wqeqwretfdasffc')
or_conn = pymssql.connect(host="116.224.93.245", port="1433", user="sa", password="frp992", database="vsale",
charset='utf8')
or_cur = or_conn.cursor()
or_cur.execute("""select contact,phone1,phone2,id_oper,reg_date,addr,memo,cust_id, id_val from cust c
where c.oe_flig is null or c.oe_flig = 'FALSE'""")
new_all = or_cur.fetchall()
logger.debug('new_all is %s'% new_all)