當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。