这些获取之间有什么区别。?请给我一个参考网站的例子以获得清晰的想法。我仍然对此感到困惑
res = cr.dictfetchall()
res2 = cr.dictfetchone()
res3 = cr.fetchall()
res4 = cr.fetchone()
cr 是当前行,来自数据库游标 (OPENERP 7 )
前任 :
def _max_reg_no(self, cr, uid, context=None):
cr.execute("""
select register_no as reg_no
from bpl_worker
where id in (select max(id) from bpl_worker)
""")
res = cr.fetchone()[0]
print (res)
return res