当前位置: 首页>>代码示例>>Python>>正文


Python Ticket.gets_all_opened方法代码示例

本文整理汇总了Python中vilya.models.ticket.Ticket.gets_all_opened方法的典型用法代码示例。如果您正苦于以下问题:Python Ticket.gets_all_opened方法的具体用法?Python Ticket.gets_all_opened怎么用?Python Ticket.gets_all_opened使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vilya.models.ticket.Ticket的用法示例。


在下文中一共展示了Ticket.gets_all_opened方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _q_index

# 需要导入模块: from vilya.models.ticket import Ticket [as 别名]
# 或者: from vilya.models.ticket.Ticket import gets_all_opened [as 别名]
def _q_index(request):
    user = request.user
    if user:
        list_type = request.get_form_var("list_type", "invited")

        n_invited = user.n_open_invited
        n_participated = user.n_open_participated
        n_yours = user.n_user_open_submit_pull_requests
        counts = [n_invited, n_participated, n_yours, None]
        tab_info = []
        for tab, count in zip(MY_PULL_REQUESTS_TAB_INFO, counts):
            tab.update(count=count)
            tab_info.append(tab)

        if list_type == "participated":
            tickets = user.get_participated_pull_requests()
        elif list_type == "yours":
            tickets = user.get_user_submit_pull_requests()
        elif list_type == "explore":
            from vilya.models.ticket import Ticket
            tickets = Ticket.gets_all_opened()
            ticket_total_len = len(tickets)
            shuffle(tickets)
        else:
            tickets = user.get_invited_pull_requests()
        is_closed_tab = False
        ticket_total_len = len(tickets)
        return st('my_pull_requests.html', **locals())
开发者ID:000fan000,项目名称:code,代码行数:30,代码来源:my_pull_requests.py

示例2: test_ticket_gets_all_opened

# 需要导入模块: from vilya.models.ticket import Ticket [as 别名]
# 或者: from vilya.models.ticket.Ticket import gets_all_opened [as 别名]
 def test_ticket_gets_all_opened(self):
     title = 'test title'
     desc = 'test desc'
     author = 'testuser'
     Ticket.add(self.proj1.id, title, desc, author)
     assert Ticket.gets_all_opened() != []
开发者ID:leeccong,项目名称:code,代码行数:8,代码来源:test_ticket.py


注:本文中的vilya.models.ticket.Ticket.gets_all_opened方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。