当前位置: 首页>>代码示例>>Python>>正文


Python CodeDoubanProject.gets方法代码示例

本文整理汇总了Python中vilya.models.project.CodeDoubanProject.gets方法的典型用法代码示例。如果您正苦于以下问题:Python CodeDoubanProject.gets方法的具体用法?Python CodeDoubanProject.gets怎么用?Python CodeDoubanProject.gets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vilya.models.project.CodeDoubanProject的用法示例。


在下文中一共展示了CodeDoubanProject.gets方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: update_repo_indexes

# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import gets [as 别名]
    def update_repo_indexes(cls):
        old_obj_ids = cls.query_repo_objs()
        old_obj_ids = [id for id, in old_obj_ids]
        new_obj_ids = CodeDoubanProject.get_project_ids_sortby_sumup()
        new_objs = CodeDoubanProject.gets(new_obj_ids)
        to_delete_ids = set(old_obj_ids) - set(new_obj_ids)

        cls.delete_repo_indexes(to_delete_ids)

        index_data = [cls.get_repo_index_from_project(project)
                      for project in new_objs]
        indexes = [(data['id'], data) for data in index_data]
        IndexEngine.create_index_bulk('repo', indexes)
开发者ID:000fan000,项目名称:code,代码行数:15,代码来源:repo_search.py

示例2: _q_index

# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import gets [as 别名]
def _q_index(request):
    sortby = request.get_form_var('sortby')
    if sortby in CodeDoubanProject.PROJECTS_SORT_BYS:
        project_list = CodeDoubanProject.get_projects(sortby=sortby)
    else:
        project_list = CodeDoubanProject.get_projects()

    team_uid = request.get_form_var('by_dept', '')
    team = Team.get_by_uid(team_uid)
    if team:
        project_ids = team.project_ids
        project_list = (CodeDoubanProject.gets(project_ids)
                        if project_ids else [])

    without_commits = request.get_form_var('without_commits') or False
    data = {}
    data['projects'] = [project.get_info(
        without_commits=without_commits) for project in project_list]
    return json.dumps(data)
开发者ID:000fan000,项目名称:code,代码行数:21,代码来源:projects.py

示例3: related_projects

# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import gets [as 别名]
 def related_projects(self):
     rs = store.execute('select project_id from issue_related_projects '
                        'where issue_id=%s', (self.issue_id,))
     prj_ids = [id for (id, ) in rs]
     from vilya.models.project import CodeDoubanProject
     return CodeDoubanProject.gets(prj_ids)
开发者ID:000fan000,项目名称:code,代码行数:8,代码来源:fair_issue.py

示例4: get_projects

# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import gets [as 别名]
def get_projects():
    rs = store.execute('select project_id from codedouban_projects')
    ids = (proj_id for proj_id, in rs)
    return CodeDoubanProject.gets(ids)
开发者ID:000fan000,项目名称:code,代码行数:6,代码来源:init_index.py


注:本文中的vilya.models.project.CodeDoubanProject.gets方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。