本文整理汇总了Python中lp.services.database.interfaces.IMasterStore.commit方法的典型用法代码示例。如果您正苦于以下问题:Python IMasterStore.commit方法的具体用法?Python IMasterStore.commit怎么用?Python IMasterStore.commit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lp.services.database.interfaces.IMasterStore
的用法示例。
在下文中一共展示了IMasterStore.commit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __call__
# 需要导入模块: from lp.services.database.interfaces import IMasterStore [as 别名]
# 或者: from lp.services.database.interfaces.IMasterStore import commit [as 别名]
def __call__(self, chunk_size):
self.logger.info(
"%s (limited to %d rows)", self.statement.splitlines()[0],
chunk_size)
store = IMasterStore(DistroSeries)
result = store.execute(self.statement, (self.series.id, chunk_size,))
self.done = (result.rowcount == 0)
self.logger.info(
"%d rows deleted (%s)", result.rowcount,
("done" if self.done else "not done"))
store.commit()
示例2: main
# 需要导入模块: from lp.services.database.interfaces import IMasterStore [as 别名]
# 或者: from lp.services.database.interfaces.IMasterStore import commit [as 别名]
def main(self):
"Run UpdateDatabaseTableStats."""
store = IMasterStore(Person)
# The logic is in a stored procedure because we want to run
# ps(1) on the database server rather than the host this script
# is running on.
self.logger.debug("Invoking update_database_stats()")
store.execute("SELECT update_database_stats()", noresult=True)
self.logger.debug("Committing")
store.commit()