本文整理汇总了Python中vilya.models.project.CodeDoubanProject.get_projects方法的典型用法代码示例。如果您正苦于以下问题:Python CodeDoubanProject.get_projects方法的具体用法?Python CodeDoubanProject.get_projects怎么用?Python CodeDoubanProject.get_projects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vilya.models.project.CodeDoubanProject
的用法示例。
在下文中一共展示了CodeDoubanProject.get_projects方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _q_index
# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import get_projects [as 别名]
def _q_index(request):
user = request.user
my_issues = []
if user:
username = user.username
your_projects = CodeDoubanProject.get_projects(owner=username,
sortby='lru')
watched_projects = CodeDoubanProject.get_watched_others_projects_by_user( # noqa
user=username,
sortby='lru')
teams = Team.get_by_user_id(user.name)
actions = get_user_inbox(username).get_actions(
stop=PAGE_ACTIONS_COUNT - 1)
badge_items = user.get_badge_items()
# pull request
# your_tickets = user.get_user_pull_requests_rank(limit=5)
your_tickets = user.get_user_submit_pull_requests(limit=5)
# issue
project_ids = CodeDoubanProject.get_ids(user.name)
dt = {
'state': "open",
'limit': 5,
'start': 0,
}
my_issues = ProjectIssue.gets_by_project_ids(project_ids, **dt)
return st('newsfeed.html', **locals())
return request.redirect("/teams/")
示例2: _q_index
# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import get_projects [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: yours
# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import get_projects [as 别名]
def yours(request):
user = request.user
actions = (get_user_feed(user.username)
.get_actions(stop=PAGE_ACTIONS_COUNT - 1))
your_projects = CodeDoubanProject.get_projects(
owner=user.username, sortby="lru")
watched_projects = CodeDoubanProject.get_watched_others_projects_by_user(
user=user.username, sortby='lru')
badge_items = user.get_badge_items()
return st('my_actions.html', **locals())
示例4: update_user_indexes
# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import get_projects [as 别名]
def update_user_indexes(cls):
old_obj_names = cls.query_user_objs()
old_obj_names = set(name for name, in old_obj_names)
projects = CodeDoubanProject.get_projects()
new_obj_names = set(project.owner_name for project in projects)
to_delete_names = old_obj_names - new_obj_names
cls.delete_user_indexes(to_delete_names)
index_data = [cls.get_user_index(User(u)) for u in new_obj_names]
indexes = [(data['name'].encode('hex'), data) for data in index_data]
IndexEngine.create_index_bulk('user', indexes)
示例5: _q_index
# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import get_projects [as 别名]
def _q_index(self, request):
name = self.name
your_projects = CodeDoubanProject.get_projects(owner=name, sortby="lru")
actions = get_user_feed(name).get_actions(0, 20)
user = User(name)
teams = Team.get_by_user_id(user.name)
badge_items = user.get_badge_items()
followers_count = user.followers_count
following_count = user.following_count
if user and user.username == name and user.get_new_badges():
user.clear_new_badges()
return st("people.html", **locals())
示例6: main
# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import get_projects [as 别名]
def main():
try:
mirror_projects = CodeDoubanProject.get_projects(owner='mirror', sortby='created')
for project in mirror_projects:
mirror = CodeDoubanMirror.get_by_project_id(project.id)
if not mirror:
print "New: ", project.id, project.name, project.url
mirror_url = project.git.call('ls-remote --get-url origin')
CodeDoubanMirror.add(mirror_url, MIRROR_STATE_CLONED, project.id)
else:
print "Added: ", project.id, project.name, project.url
except Exception, e:
print_exc()
sys.exit(1)
示例7: _q_index
# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import get_projects [as 别名]
def _q_index(request):
your_projects = CodeDoubanProject.get_projects(
owner="mirror", sortby='sumup')
return st('/mirrors.html', **locals())
示例8: repos
# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import get_projects [as 别名]
def repos(request):
projects = CodeDoubanProject.get_projects(owner=request.user.username)
return [project.as_dict() for project in projects]
示例9: index_users
# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import get_projects [as 别名]
def index_users(cls):
projects = CodeDoubanProject.get_projects()
user_names = set(project.owner_name for project in projects)
index_data = [cls.get_user_index(User(u)) for u in user_names]
indexes = [(data['name'].encode('hex'), data) for data in index_data]
IndexEngine.create_index_bulk('user', indexes)
示例10: index_repos
# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import get_projects [as 别名]
def index_repos(cls):
projects = CodeDoubanProject.get_projects(sortby='sumup')
index_data = [cls.get_repo_index_from_project(project)
for project in projects]
indexes = [(data['id'], data) for data in index_data]
IndexEngine.create_index_bulk('repo', indexes)