本文整理汇总了Python中base_models.DBSession.commit方法的典型用法代码示例。如果您正苦于以下问题:Python DBSession.commit方法的具体用法?Python DBSession.commit怎么用?Python DBSession.commit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类base_models.DBSession
的用法示例。
在下文中一共展示了DBSession.commit方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: save
# 需要导入模块: from base_models import DBSession [as 别名]
# 或者: from base_models.DBSession import commit [as 别名]
def save():
print('{line} -> {ip} {forwarder} {is_send} {mti} {bits}'.format(
line=r_log.line, ip=ip, forwarder=forwarder, is_send=is_send, mti=mti,
bits=bits))
r_iso = Iso()
r_iso.id = conf.nilai_int = r_log.id
r_iso.tgl = r_log.tgl
r_iso.jenis_id = r_log.jenis_id
r_iso.kategori_id = r_log.kategori_id
r_iso.ip = ip
r_iso.forwarder = forwarder
r_iso.is_send = is_send
r_iso.mti = mti
for key in bits:
value = bits[key]
n = str(key).zfill(3)
fieldname = 'bit_{n}'.format(n=n)
setattr(r_iso, fieldname, value)
DBSession.add(r_iso)
conf.updated = create_now()
DBSession.add(conf)
try:
DBSession.flush()
except IntegrityError as err:
s_err = str(err)
if s_err.find('duplicate key') > -1:
print(' sudah ada')
DBSession.rollback()
else:
raise(err)
DBSession.commit()
示例2: inquiry_request_handler
# 需要导入模块: from base_models import DBSession [as 别名]
# 或者: from base_models.DBSession import commit [as 别名]
def inquiry_request_handler(self):
try:
self.save_request_log()
self._inquiry_request_handler()
self.save_response_log()
DBSession.commit()
except:
self.ack_unknown()
示例3: set_unpaid
# 需要导入模块: from base_models import DBSession [as 别名]
# 或者: from base_models.DBSession import commit [as 别名]
def set_unpaid(self):
pay = Reversal.set_unpaid(self)
if not pay:
q = DBSession.query(self.models.Payment).filter_by(
propinsi=self.invoice.kd_propinsi,
kabupaten=self.invoice.kd_dati2,
kecamatan=self.invoice.kd_kecamatan,
kelurahan=self.invoice.kd_kelurahan,
blok=self.invoice.kd_blok,
urut=self.invoice.no_urut,
jenis=self.invoice.kd_jns_op,
tahun=self.invoice.thn_pajak_sppt)
q.delete()
DBSession.commit()
示例4: commit
# 需要导入模块: from base_models import DBSession [as 别名]
# 或者: from base_models.DBSession import commit [as 别名]
def commit(self):
DBSession.commit()
OtherDBSession.commit()
示例5: commit
# 需要导入模块: from base_models import DBSession [as 别名]
# 或者: from base_models.DBSession import commit [as 别名]
def commit(self):
DBSession.commit()
self.parent.ack()
示例6: save_conf
# 需要导入模块: from base_models import DBSession [as 别名]
# 或者: from base_models.DBSession import commit [as 别名]
def save_conf():
conf.nilai_int = r_iso.id
conf.updated = create_now()
DBSession.add(conf)
DBSession.flush()
DBSession.commit()