本文整理匯總了Python中models.Issue.title方法的典型用法代碼示例。如果您正苦於以下問題:Python Issue.title方法的具體用法?Python Issue.title怎麽用?Python Issue.title使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models.Issue
的用法示例。
在下文中一共展示了Issue.title方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_digest
# 需要導入模塊: from models import Issue [as 別名]
# 或者: from models.Issue import title [as 別名]
def get_digest(self):
"""
builds a DigestData instance filled with the digest
"""
issue_list = list(self.get_issues())
digest = DigestData()
digest.user = self._user
digest.repo = self._repository_name
for github_issue in issue_list:
if github_issue.state == IssueStates.OPEN:
digest.total_opened += 1
elif github_issue.state == IssueStates.CLOSED:
digest.total_closed += 1
digest.total_issues += 1
issue = Issue()
issue.url = github_issue.html_url
issue.label = '{}/{}#{}'.format(self._user, self._repository_name, github_issue.number)
issue.title = github_issue.title
issue.state = github_issue.state
github_user = github_issue.user
display_name = github_user.name or github_user.login
if display_name not in digest.users:
user = User()
user.name = display_name
user.gravatar = github_user.avatar_url
digest.users[display_name] = user
digest.issues.setdefault(display_name, []).append(issue)
return digest
示例2: reconcile_db_with_gh
# 需要導入模塊: from models import Issue [as 別名]
# 或者: from models.Issue import title [as 別名]
def reconcile_db_with_gh(*args, **kwargs):
ghc = GitHubConnector()
issues = ghc.get_all_issues()
repos = ghc.get_all_repos()
for repo in repos:
r = Repo(github_id=repo.id, name=repo.name)
r.save()
for issue in issues:
i = Issue(github_id=issue.id)
i.title = issue.title
i.number = issue.number
i.repo = Repo.objects.get(name=issue.repository[1])
i.save()
print "Not only did your task run successfully, but you're damned good looking too."