本文整理汇总了Python中notification.models.TaskHistory.db_id方法的典型用法代码示例。如果您正苦于以下问题:Python TaskHistory.db_id方法的具体用法?Python TaskHistory.db_id怎么用?Python TaskHistory.db_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类notification.models.TaskHistory
的用法示例。
在下文中一共展示了TaskHistory.db_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: register_task
# 需要导入模块: from notification.models import TaskHistory [as 别名]
# 或者: from notification.models.TaskHistory import db_id [as 别名]
def register_task(self, database):
task_history = TaskHistory()
task_history.task_id = datetime.now().strftime("%Y%m%d%H%M%S")
task_history.task_name = self.TASK_NAME
task_history.relevance = TaskHistory.RELEVANCE_WARNING
task_history.task_status = TaskHistory.STATUS_RUNNING
task_history.context = {'hostname': gethostname()}
task_history.user = 'admin'
task_history.db_id = database.id
task_history.object_class = "logical_database"
task_history.object_id = database.id
task_history.database_name = database.name
task_history.arguments = 'Database_name: {}'.format(database.name)
task_history.save()
return task_history