本文整理汇总了Python中vilya.models.project_issue.ProjectIssue.get_by_proj_name_and_number方法的典型用法代码示例。如果您正苦于以下问题:Python ProjectIssue.get_by_proj_name_and_number方法的具体用法?Python ProjectIssue.get_by_proj_name_and_number怎么用?Python ProjectIssue.get_by_proj_name_and_number使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vilya.models.project_issue.ProjectIssue
的用法示例。
在下文中一共展示了ProjectIssue.get_by_proj_name_and_number方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mute
# 需要导入模块: from vilya.models.project_issue import ProjectIssue [as 别名]
# 或者: from vilya.models.project_issue.ProjectIssue import get_by_proj_name_and_number [as 别名]
def mute(request):
''' mute ticket(pr) or issue, just 'project' scope yet. '''
user = request.user
if user:
entry_type = request.get_form_var('type', '')
target = request.get_form_var('target', '')
entry_id = request.get_form_var('id', '')
if entry_type == 'pull':
Mute.mute('ticket', target, entry_id, user)
elif entry_type == 'issue':
# TODO: models.issue.leave or mute
issue = ProjectIssue.get_by_proj_name_and_number(target, entry_id)
if user.name != issue.creator_id:
issue.delete_participant(user.name)
return dict(r=0)
else:
return dict(r=1)