本文整理汇总了Python中tribal.model.DBSession.execute方法的典型用法代码示例。如果您正苦于以下问题:Python DBSession.execute方法的具体用法?Python DBSession.execute怎么用?Python DBSession.execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tribal.model.DBSession
的用法示例。
在下文中一共展示了DBSession.execute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _getSystemNo
# 需要导入模块: from tribal.model import DBSession [as 别名]
# 或者: from tribal.model.DBSession import execute [as 别名]
def _getSystemNo():
s = Sequence( 'rp_main_form_seq' )
s.create( DBSession.bind, checkfirst = True ) # if the seq is existed ,don't create again
c = DBSession.execute( s )
prefix = 'OTHER'
for g in request.identity["user"].groups:
for profile in g.prepress_profiles:
if profile.region_id :
prefix = profile.region.code
break
# return "RP%s%.6d" % ( prefix, c )
return "RP%s%s" % ( prefix, c )
示例2: update_blank_awb_dn
# 需要导入模块: from tribal.model import DBSession [as 别名]
# 或者: from tribal.model.DBSession import execute [as 别名]
def update_blank_awb_dn(cls, dn_no, awb_no):
if awb_no and dn_no:
sql = '''
update mglobal_erp_dnd set awb_no='%s' where dn_no='%s'
''' % (awb_no, dn_no)
DBSession.execute(sql)
示例3: update_in_mp_order
# 需要导入模块: from tribal.model import DBSession [as 别名]
# 或者: from tribal.model.DBSession import execute [as 别名]
def update_in_mp_order(cls, cust_po_no_list):
if cust_po_no_list:
sql = 'update mglobal_erp_so set in_mp_order=true where (%s) and (in_mp_order=false or in_mp_order is null)' % 'cust_po_no=\'%s\'' % '\' or cust_po_no=\''.join(cust_po_no_list)
DBSession.execute(sql)