本文整理汇总了Python中vilya.models.ticket.Ticket.gets方法的典型用法代码示例。如果您正苦于以下问题:Python Ticket.gets方法的具体用法?Python Ticket.gets怎么用?Python Ticket.gets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vilya.models.ticket.Ticket
的用法示例。
在下文中一共展示了Ticket.gets方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from vilya.models.ticket import Ticket [as 别名]
# 或者: from vilya.models.ticket.Ticket import gets [as 别名]
def get(self, request):
_date_from = None
_date_to = None
state = request.get_form_var('state', '')
author = request.get_form_var('author', '')
date_from = request.get_form_var('from', '')
date_to = request.get_form_var('to', '')
if not state or state == "open":
closed = False
else:
closed = True
if date_from:
_date_from = date_from
if date_to:
_date_to = date_to
tickets = Ticket.gets(project_id=self.repo.id,
author=author,
date_from=_date_from,
date_to=_date_to,
closed=closed)
pulls = []
for t in tickets:
pull = PullRequest.get_by_proj_and_ticket(self.repo.id,
t.ticket_number)
pulls.append(pull.as_dict())
return pulls