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


Python api.ParamFilter类代码示例

本文整理汇总了Python中fedoracommunity.connectors.api.ParamFilter的典型用法代码示例。如果您正苦于以下问题:Python ParamFilter类的具体用法?Python ParamFilter怎么用?Python ParamFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: register_query_conflicts

    def register_query_conflicts(cls):
        path = cls.register_query(
                      'query_conflicts',
                      cls.query_conflicts,
                      primary_key_col = 'name',
                      default_sort_col = 'name',
                      default_sort_order = -1,
                      can_paginate = True)

        path.register_column('name',
                        default_visible = True,
                        can_sort = True,
                        can_filter_wildcards = False)

        path.register_column('flags',
                        default_visible = False,
                        can_sort = False,
                        can_filter_wildcards = False)

        path.register_column('version',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('ops',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)

        f = ParamFilter()
        f.add_filter('package',[], allow_none = False)
        f.add_filter('version',[], allow_none = False)
        f.add_filter('repo',[], allow_none = False)
        f.add_filter('arch',[], allow_none = False)
        cls._query_conflicts_filter = f
开发者ID:Fale,项目名称:fedora-packages,代码行数:34,代码来源:yumconnector.py

示例2: register_query_changelogs

    def register_query_changelogs(cls):
        path = cls.register_query(
                      'query_changelogs',
                      cls.query_changelogs,
                      primary_key_col = 'id',
                      default_sort_col = 'date',
                      default_sort_order = -1,
                      can_paginate = True)

        path.register_column('id',
                        default_visible = True,
                        can_sort = True,
                        can_filter_wildcards = False)

        path.register_column('date',
                        default_visible = True,
                        can_sort = True,
                        can_filter_wildcards = False)

        path.register_column('author',
                        default_visible = True,
                        can_sort = True,
                        can_filter_wildcards = False)

        path.register_column('text',
                        default_visible = True,
                        can_sort = True,
                        can_filter_wildcards = False)

        f = ParamFilter()
        f.add_filter('build_id',[], allow_none = False)
        cls._query_changelogs_filter = f

        cls._changelog_version_extract_re = re.compile('(.*)\W*<(.*)>\W*-?\W*(.*)')
开发者ID:arielb2,项目名称:fedora-packages,代码行数:34,代码来源:kojiconnector.py

示例3: register_query_userinfo

    def register_query_userinfo(cls):
        cls.register_query(
            'query_userinfo',
            cls.query_userinfo,
            can_paginate=False)

        f = ParamFilter()
        f.add_filter('username', ['u', 'user', 'name'], allow_none=False)
        f.add_filter('profile', list(), allow_none=True)
        cls._query_userinfo_filter = f
开发者ID:Fale,项目名称:fedora-packages,代码行数:10,代码来源:fasconnector.py

示例4: register_query_acls

    def register_query_acls(cls):
        path = cls.register_query(
                      'acls',
                      cls.query_acls,
                      primary_key_col = 'username',
                      default_sort_col = 'username',
                      default_sort_order = -1,
                      can_paginate = True)

        path.register_column('username',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)

        path.register_column('roles',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        f = ParamFilter()
        f.add_filter('package',['p', 'pkg'], allow_none = False)
        f.add_filter('roles', allow_none = True)
        f.add_filter('type', allow_none = False)
        f.add_filter('release', allow_none = False)

        cls._query_acls_filter = f
开发者ID:Fale,项目名称:fedora-packages,代码行数:25,代码来源:pkgdbconnector.py

示例5: register_query_packages

    def register_query_packages(cls):
        path = cls.register_query(
                      'query_packages',
                      cls.query_packages,
                      primary_key_col = 'id',
                      default_sort_col = 'name',
                      default_sort_order = 1,
                      can_paginate = True)

        path.register_column('id',
                        default_visible = True,
                        can_sort = True,
                        can_filter_wildcards = False)

        path.register_column('name',
                        default_visible = True,
                        can_sort = True,
                        can_filter_wildcards = False)

        f = ParamFilter()
        f.add_filter('prefix',[], allow_none = False)
        cls._query_packages_filter = f
开发者ID:arielb2,项目名称:fedora-packages,代码行数:22,代码来源:kojiconnector.py

示例6: register_query_active_releases

    def register_query_active_releases(cls):
        path = cls.register_query('query_active_releases',
                                  cls.query_active_releases,
                                  primary_key_col='release',
                                  default_sort_col='release',
                                  default_sort_order=-1,
                                  can_paginate=True)
        path.register_column('release',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('stable_version',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('testing_version',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)

        f = ParamFilter()
        f.add_filter('package', ['nvr'], allow_none=False)
        cls._query_active_releases = f
开发者ID:arielb2,项目名称:fedora-packages,代码行数:23,代码来源:bodhiconnector.py

示例7: register_query_people

    def register_query_people(cls):
        path = cls.register_query(
                      'query_people',
                      cls.query_people,
                      primary_key_col = 'username',
                      default_sort_col = 'username',
                      default_sort_order = -1,
                      can_paginate = True)

        path.register_column('username',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('human_name',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)

        f = ParamFilter()
        f.add_filter('prefix',
                     allow_none = False)

        cls._query_people_filter = f
开发者ID:arielb2,项目名称:fedora-packages,代码行数:23,代码来源:fasconnector.py

示例8: register_query_conflicts

    def register_query_conflicts(cls):
        path = cls.register_query(
            "query_conflicts",
            cls.query_conflicts,
            primary_key_col="name",
            default_sort_col="name",
            default_sort_order=-1,
            can_paginate=True,
        )

        path.register_column("name", default_visible=True, can_sort=True, can_filter_wildcards=False)

        path.register_column("flags", default_visible=False, can_sort=False, can_filter_wildcards=False)

        path.register_column("version", default_visible=True, can_sort=False, can_filter_wildcards=False)
        path.register_column("ops", default_visible=True, can_sort=False, can_filter_wildcards=False)

        f = ParamFilter()
        f.add_filter("package", [], allow_none=False)
        f.add_filter("version", [], allow_none=False)
        f.add_filter("repo", [], allow_none=False)
        f.add_filter("arch", [], allow_none=False)
        cls._query_conflicts_filter = f
开发者ID:nanonyme,项目名称:fedora-packages,代码行数:23,代码来源:yumconnector.py

示例9: register_query_obsoletes

    def register_query_obsoletes(cls):
        path = cls.register_query(
            'query_obsoletes',
            cls.query_obsoletes,
            primary_key_col='name',
            default_sort_col='name',
            default_sort_order=-1,
            can_paginate=True)

        path.register_column(
            'name',
            default_visible=True,
            can_sort=True,
            can_filter_wildcards=False)

        path.register_column(
            'flags',
            default_visible=False,
            can_sort=False,
            can_filter_wildcards=False)

        path.register_column(
            'version',
            default_visible=True,
            can_sort=False,
            can_filter_wildcards=False)

        path.register_column(
            'ops',
            default_visible=True,
            can_sort=False,
            can_filter_wildcards=False)

        f = ParamFilter()
        f.add_filter('nvr', list(), allow_none=False)
        f.add_filter('arch', list(), allow_none=False)
        cls._query_obsoletes_filter = f
开发者ID:Fale,项目名称:fedora-packages,代码行数:37,代码来源:kojiconnector.py

示例10: register_query_problems

    def register_query_problems(cls):
        path = cls.register_query(
            'query_problems',
            cls.query_problems,
            cache_prompt=None,
            primary_key_col='id',
            default_sort_col='count',
            default_sort_order=-1,
            can_paginate=True)

        path.register_column(
            'id',
            default_visible=True,
            can_sort=True,
            can_filter_wildcards=False)

        path.register_column(
            'status',
            default_visible=True,
            can_sort=True,
            can_filter_wildcards=False)

        path.register_column(
            'crash_function',
            default_visible=True,
            can_sort=True,
            can_filter_wildcards=True)

        path.register_column(
            'count',
            default_visible=True,
            can_sort=True,
            can_filter_wildcards=False)

        f = ParamFilter()
        f.add_filter('package_name', list(), allow_none=False)
        cls._query_problems_filter = f
开发者ID:fedora-infra,项目名称:fedora-packages,代码行数:37,代码来源:fafconnector.py

示例11: register_query_bugs

    def register_query_bugs(cls):
        path = cls.register_query(
            'query_bugs',
            cls.query_bugs,
            cache_prompt=None, #cls.cache_prompt,
            primary_key_col='id',
            default_sort_col='date',
            default_sort_order=-1,
            can_paginate=True)

        path.register_column(
            'id',
            default_visible=True,
            can_sort=True,
            can_filter_wildcards=False)

        path.register_column(
            'status',
            default_visible=True,
            can_sort=True,
            can_filter_wildcards=False)

        path.register_column(
            'description',
            default_visible=True,
            can_sort=True,
            can_filter_wildcards=False)

        path.register_column(
            'release',
            default_visible=True,
            can_sort=True,
            can_filter_wildcards=False)

        f = ParamFilter()
        f.add_filter('package', [], allow_none=False)
        f.add_filter('collection', [], allow_none=False)
        f.add_filter('version', [], allow_none=False)
        cls._query_bugs_filter = f
开发者ID:Akki356,项目名称:fedora-packages,代码行数:39,代码来源:bugzillaconnector.py

示例12: register_query_updates

    def register_query_updates(cls):
        path = cls.register_query(
                      'query_updates',
                      cls.query_updates,
                      primary_key_col = 'request_id',
                      default_sort_col = 'request_id',
                      default_sort_order = -1,
                      can_paginate = True)

        path.register_column('request_id',
                        default_visible = False,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('updateid',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('nvr',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('submitter',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('status',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('request',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('karma',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('nagged',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('type',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('approved',
                        default_visible = True,
                        can_sort = False,
                     can_filter_wildcards = False)
        path.register_column('date_submitted',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('date_pushed',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('date_modified',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('comments',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('bugs',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('builds',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('releases',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('release',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('karma_level',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)

        def _profile_user(conn, filter_dict, key, value, allow_none):
            if value:
                user = None
                ident = conn._environ.get('repoze.who.identity')
                if ident:
                    user = ident.get('repoze.who.userid')
                if user or allow_none:
                    filter_dict['username'] = user

        f = ParamFilter()
        f.add_filter('package', ['nvr'], allow_none=False)
        f.add_filter('user',['u', 'username', 'name'], allow_none = False)
        f.add_filter('profile',[], allow_none=False,
                     filter_func=_profile_user,
#.........这里部分代码省略.........
开发者ID:arielb2,项目名称:fedora-packages,代码行数:101,代码来源:bodhiconnector.py

示例13: register_query_usermemberships

    def register_query_usermemberships(cls):
        path = cls.register_query(
            'query_usermemberships',
            cls.query_usermemberships,
            primary_key_col='id',
            default_sort_col='name',
            default_sort_order=-1,
            can_paginate=True)

        path.register_column('id',
                             default_visible=False,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('name',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('display_name',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('group_type',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('irc_channel',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('irc_network',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('joinmsg',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('mailing_list',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('mailing_list_url',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('needs_sponsor',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('owner_id',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('prerequisite_id',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False),
        path.register_column('url',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('user_can_remove',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('apply_rules',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('creation',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)

        f = ParamFilter()
        f.add_filter('username', ['u', 'user', 'name'], allow_none=False)
        f.add_filter('profile', list(), allow_none=True)
        f.add_filter('show_approved', ['approved', 'a'], allow_none=True)
        f.add_filter('show_unapproved', ['unapproved', 'un'], allow_none=True)
        cls._query_usermemberships_filter = f
开发者ID:Fale,项目名称:fedora-packages,代码行数:80,代码来源:fasconnector.py

示例14: register_query_builds

    def register_query_builds(cls):
        path = cls.register_query(
            'query_builds',
            cls.query_builds,
            cls.query_builds_cache_prompt,
            primary_key_col='build_id',
            default_sort_col='build_id',
            default_sort_order=-1,
            can_paginate=True)

        path.register_column(
            'build_id',
            default_visible=True,
            can_sort=True,
            can_filter_wildcards=False)

        path.register_column(
            'nvr',
            default_visible=True,
            can_sort=True,
            can_filter_wildcards=False)

        path.register_column(
            'owner_name',
            default_visible=True,
            can_sort=True,
            can_filter_wildcards=False)

        path.register_column(
            'state',
            default_visible=True,
            can_sort=True,
            can_filter_wildcards=False)

        def _profile_user(conn, filter_dict, key, value, allow_none):
            d = filter_dict

            if value:
                user = None

                ident = conn._environ.get('repoze.who.identity')
                if ident:
                    user = ident.get('repoze.who.userid')

                if user or allow_none:
                    d['user'] = user

        f = ParamFilter()
        f.add_filter('user', ['u', 'username', 'name'], allow_none=False)
        f.add_filter('profile', list(), allow_none=False,
                     filter_func=_profile_user,
                     cast=bool)
        f.add_filter('package', ['p'], allow_none=True)
        f.add_filter('state', ['s'], allow_none=True)
        f.add_filter('query_updates', allow_none=True, cast=bool)
        cls._query_builds_filter = f
开发者ID:Akki356,项目名称:fedora-packages,代码行数:56,代码来源:kojiconnector.py

示例15: register_query_userpackages

    def register_query_userpackages(cls):
        path = cls.register_query(
                      'query_userpackages',
                      cls.query_userpackages,
                      primary_key_col = 'id',
                      default_sort_col = 'name',
                      default_sort_order = -1,
                      can_paginate = True)

        path.register_column('id',
                        default_visible = False,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('name',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('summary',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('description',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('reviewurl',
                        default_visible = False,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('shouldopen',
                        default_visible = False,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('statuscode',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('collections',
                        default_visible = False,
                        can_sort = False,
                        can_filter_wildcards = False)

        def filter_acls(conn, d, k, v, allow_none):
            acls = []
            if 'acls' in d:
                acls = d['acls']

            acls.append(k)
            d['acls'] = acls

        f = ParamFilter()
        f.add_filter('fasname',['u', 'user', 'name', 'username'], allow_none = False)
        f.add_filter('owner', ['o'], cast=bool, allow_none = False, filter_func=filter_acls)
        f.add_filter('maintainer', ['m', 'commit'], cast=bool, allow_none = False, filter_func=filter_acls)
        f.add_filter('approveacls', ['a', 'acls'], cast=bool, allow_none = False, filter_func=filter_acls)
        f.add_filter('watchcommits', ['wc'], cast=bool, allow_none = False, filter_func=filter_acls)
        f.add_filter('watchbugzilla', ['wb', 'bugs'], cast=bool, allow_none = False, filter_func=filter_acls)
        f.add_filter('eol', [], cast=bool)

        cls._query_userpackages_filter = f
开发者ID:Fale,项目名称:fedora-packages,代码行数:60,代码来源:pkgdbconnector.py


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