當前位置: 首頁>>代碼示例>>Python>>正文


Python Issue.get_cached_issues方法代碼示例

本文整理匯總了Python中vilya.models.issue.Issue.get_cached_issues方法的典型用法代碼示例。如果您正苦於以下問題:Python Issue.get_cached_issues方法的具體用法?Python Issue.get_cached_issues怎麽用?Python Issue.get_cached_issues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在vilya.models.issue.Issue的用法示例。


在下文中一共展示了Issue.get_cached_issues方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_multi_by

# 需要導入模塊: from vilya.models.issue import Issue [as 別名]
# 或者: from vilya.models.issue.Issue import get_cached_issues [as 別名]
    def get_multi_by(cls, *a, **kw):
        """ A wrapper to get project issues """
        # args
        issue_ids = kw.get('issue_ids')
        project = kw.get('project')
        creator = kw.get('creator')
        assignee = kw.get('assignee')
        state = kw.get('state')
        start = kw.get('start')
        limit = kw.get('limit')
        milestone = kw.get('milestone')
        tags = kw.get('tags')
        order = kw.get('order')
        ids = None

        # get ids
        issue_ids = cls._get_ids_by_project_id(
            project.id, order=order,
            state=state) if not issue_ids else issue_ids
        if milestone:
            ids = set(issue_ids) & set(milestone.issue_ids)
        if tags:
            ids = set(issue_ids) if not ids else ids
            for tag in tags:
                ids = ids & set(tag.project_issue_ids)
        if ids is not None:
            issue_ids = filter(lambda x: x in ids, issue_ids)
        issues = Issue.get_cached_issues(issue_ids)

        # filter
        if assignee:
            issues = filter(lambda x: x.assignee_id == assignee.name, issues)
        if creator:
            issues = filter(lambda x: x.creator_id == creator.name, issues)
        return dict(issues=issues[start:start + limit], total=len(issues))
開發者ID:000fan000,項目名稱:code,代碼行數:37,代碼來源:project_issue.py

示例2: _gets_by_people_id

# 需要導入模塊: from vilya.models.issue import Issue [as 別名]
# 或者: from vilya.models.issue.Issue import get_cached_issues [as 別名]
 def _gets_by_people_id(cls, project, people_id, state, type):
     ids = cls._get_ids_by_project_id(project, order='updated_at',
                                      state=state)
     issues = Issue.get_cached_issues(ids)
     issues = [issue for issue in issues
               if getattr(issue, type) == people_id]
     return issues
開發者ID:000fan000,項目名稱:code,代碼行數:9,代碼來源:project_issue.py

示例3: gets_by_project_ids

# 需要導入模塊: from vilya.models.issue import Issue [as 別名]
# 或者: from vilya.models.issue.Issue import get_cached_issues [as 別名]
    def gets_by_project_ids(cls, project_ids, state=None, limit=25, start=0):
        data = []
        for id in project_ids:
            data.extend(cls.get_data_by_target(id))

        data = filter_issue_ids_by_state(data, state)
        data = filter_issue_ids_by_score(data, 'updated_at')
        data = data[start:start + limit]
        ids = [issue_id for (issue_id, _, _, _) in data]
        return Issue.get_cached_issues(ids)
開發者ID:000fan000,項目名稱:code,代碼行數:12,代碼來源:project_issue.py

示例4: get_n_by_issue_ids

# 需要導入模塊: from vilya.models.issue import Issue [as 別名]
# 或者: from vilya.models.issue.Issue import get_cached_issues [as 別名]
 def get_n_by_issue_ids(cls, issue_ids, state=None):
     if not state:
         return len(issue_ids)
     else:
         issues = Issue.get_cached_issues(issue_ids)
         open_issues = [issue for issue in issues if issue and not issue.is_closed]
         close_issues = [issue for issue in issues if issue and issue.is_closed]
         if state == "open":
             return len(open_issues)
         else:
             return len(close_issues)
開發者ID:mozillazg,項目名稱:code,代碼行數:13,代碼來源:project_issue.py

示例5: _get_issues_by_project_id

# 需要導入模塊: from vilya.models.issue import Issue [as 別名]
# 或者: from vilya.models.issue.Issue import get_cached_issues [as 別名]
 def _get_issues_by_project_id(cls, id, state=None):
     '''get project issues by project id with order and issue state.'''
     ids = cls._get_ids_by_project_id(id, state=state)
     return Issue.get_cached_issues(ids)
開發者ID:000fan000,項目名稱:code,代碼行數:6,代碼來源:project_issue.py


注:本文中的vilya.models.issue.Issue.get_cached_issues方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。