本文整理匯總了Python中models.Issue.executor方法的典型用法代碼示例。如果您正苦於以下問題:Python Issue.executor方法的具體用法?Python Issue.executor怎麽用?Python Issue.executor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models.Issue
的用法示例。
在下文中一共展示了Issue.executor方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: create
# 需要導入模塊: from models import Issue [as 別名]
# 或者: from models.Issue import executor [as 別名]
def create(env, data, nxt):
data.form = form = IssueForm(env)
db = env.db
if env.request.method == 'POST':
if form.accept(env.request.POST):
deadline = form.python_data['deadline']
text = form.python_data['issue']
title, body = text, ''
chunks = text.split('\r\n\r\n', 1)
if len(chunks) > 1:
title, body = chunks
issue = Issue(title=title, proj=data.project,
author=env.user, deadline=deadline)
issue.executor = form.python_data['executor']
db.add(issue)
if body:
comment = Comment(issue=issue, raw=body, html=body, author=env.user)
db.add(comment)
db.commit()
return env.redirect_to('issue', issue=issue.id)
data.env = env
return env.template.render_to_response('create-issue', data.as_dict())