本文整理汇总了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)
示例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)
示例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)
示例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)