本文整理匯總了Python中corehq.apps.hqadmin.models.HqDeploy.get方法的典型用法代碼示例。如果您正苦於以下問題:Python HqDeploy.get方法的具體用法?Python HqDeploy.get怎麽用?Python HqDeploy.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類corehq.apps.hqadmin.models.HqDeploy
的用法示例。
在下文中一共展示了HqDeploy.get方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: handle
# 需要導入模塊: from corehq.apps.hqadmin.models import HqDeploy [as 別名]
# 或者: from corehq.apps.hqadmin.models.HqDeploy import get [as 別名]
def handle(self, *args, **options):
start = parser.parse(options['startdate'])
enddate = options['enddate']
end = parser.parse(enddate) if enddate else datetime.utcnow()
ds = HqDeploy.get_list('production', start, end)
ids = [d['id'] for d in ds]
sha_prev = None
print_row('Deploy Date', "Commit Date", "Diff")
for id in ids:
d = HqDeploy.get(id)
s = d.code_snapshot['commits'][0]
sha = s['sha']
url = "https://github.com/dimagi/commcare-hq/compare/{sha_prev}...{sha}".format(
sha=sha,
sha_prev=sha_prev
)
print_row(d.date, s['date'], url)
sha_prev = sha