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


Python System.all方法代码示例

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


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

示例1: systems

# 需要导入模块: from bkr.server.model import System [as 别名]
# 或者: from bkr.server.model.System import all [as 别名]
    def systems(self,group_id=None,*args,**kw):
        try:
            group = Group.by_id(group_id)
        except NoResultFound:
            log.exception('Group id %s is not a valid group id' % group_id)
            flash(_(u'Need a valid group to search on'))
            redirect('../groups/mine')

        systems = System.all(identity.current.user).filter(System.groups.contains(group))
        title = 'Systems in Group %s' % group.group_name
        from bkr.server.controllers import Root
        return Root()._systems(systems,title, group_id = group_id,**kw)
开发者ID:ustbgaofan,项目名称:beaker,代码行数:14,代码来源:group.py

示例2: reserve

# 需要导入模块: from bkr.server.model import System [as 别名]
# 或者: from bkr.server.model.System import all [as 别名]
    def reserve(self, action='.', *args, **kw): 
        searchvalue = None 
        reserves = System.all(identity.current.user).join('open_reservation')\
                .options(contains_eager(System.open_reservation))
        reserves_return = self._reserves(reserves, **kw)
        search_options = {}
        if reserves_return:
            if 'reserves_found' in reserves_return:
                reserves = reserves_return['reserves_found']
            if 'searchvalue' in reserves_return:
                searchvalue = reserves_return['searchvalue']
            if 'simplesearch' in reserves_return:
                search_options['simplesearch'] = reserves_return['simplesearch']

        search_bar = SearchBar(name='reservesearch',
                               label=_(u'Reserve Search'),
                               table = search_utility.SystemReserve.search.create_search_table(),
                               complete_data=search_utility.SystemReserve.search.create_complete_search_table(),
                               search_controller=url("./get_search_options_reserve"),
                               )
        reservations = [system.open_reservation for system in reserves]
                               
        reserve_grid = myPaginateDataGrid(fields=[
                                  widgets.PaginateDataGrid.Column(name='system.fqdn', getter=lambda x: make_link(url  = '/view/%s' % x.system.fqdn, text = x.system), title=u'System', options=dict(sortable=True)),
                                  widgets.PaginateDataGrid.Column(name='start_time',
                                    getter=lambda x: x.start_time,
                                    title=u'Reserved Since',
                                    options=dict(sortable=True, datetime=True)),
                                  widgets.PaginateDataGrid.Column(name='user', getter=lambda x: x.user, title=u'Current User', options=dict(sortable=True)),
                              ])

        return dict(title=u"Reserve Report",
                    grid = reserve_grid,
                    search_bar = search_bar,
                    options = search_options,
                    action=action, 
                    searchvalue = searchvalue,
                    object_count=len(reservations),
                    list=reservations)
开发者ID:sibiaoluo,项目名称:beaker,代码行数:41,代码来源:reports.py

示例3: query

# 需要导入模块: from bkr.server.model import System [as 别名]
# 或者: from bkr.server.model.System import all [as 别名]
 def query(cls):
     for system in System.all(identity.current.user):
         for pool in system.pools:
             yield CSV_SystemPool(system, pool)
开发者ID:ShaolongHu,项目名称:beaker,代码行数:6,代码来源:CSV_import_export.py

示例4: query

# 需要导入模块: from bkr.server.model import System [as 别名]
# 或者: from bkr.server.model.System import all [as 别名]
 def query(cls):
     for system in System.all(identity.current.user):
         for group in system.groups:
             yield CSV_GroupSystem(system, group)
开发者ID:sujithshankar,项目名称:beaker,代码行数:6,代码来源:CSV_import_export.py


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