本文整理汇总了Python中fedoracommunity.connectors.api.ParamFilter.add_filter方法的典型用法代码示例。如果您正苦于以下问题:Python ParamFilter.add_filter方法的具体用法?Python ParamFilter.add_filter怎么用?Python ParamFilter.add_filter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fedoracommunity.connectors.api.ParamFilter
的用法示例。
在下文中一共展示了ParamFilter.add_filter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: register_query_conflicts
# 需要导入模块: from fedoracommunity.connectors.api import ParamFilter [as 别名]
# 或者: from fedoracommunity.connectors.api.ParamFilter import add_filter [as 别名]
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
示例2: register_query_changelogs
# 需要导入模块: from fedoracommunity.connectors.api import ParamFilter [as 别名]
# 或者: from fedoracommunity.connectors.api.ParamFilter import add_filter [as 别名]
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*(.*)')
示例3: register_query_builds
# 需要导入模块: from fedoracommunity.connectors.api import ParamFilter [as 别名]
# 或者: from fedoracommunity.connectors.api.ParamFilter import add_filter [as 别名]
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
示例4: register_query_userinfo
# 需要导入模块: from fedoracommunity.connectors.api import ParamFilter [as 别名]
# 或者: from fedoracommunity.connectors.api.ParamFilter import add_filter [as 别名]
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
示例5: register_query_acls
# 需要导入模块: from fedoracommunity.connectors.api import ParamFilter [as 别名]
# 或者: from fedoracommunity.connectors.api.ParamFilter import add_filter [as 别名]
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
示例6: register_query_packages
# 需要导入模块: from fedoracommunity.connectors.api import ParamFilter [as 别名]
# 或者: from fedoracommunity.connectors.api.ParamFilter import add_filter [as 别名]
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
示例7: register_query_active_releases
# 需要导入模块: from fedoracommunity.connectors.api import ParamFilter [as 别名]
# 或者: from fedoracommunity.connectors.api.ParamFilter import add_filter [as 别名]
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
示例8: register_query_people
# 需要导入模块: from fedoracommunity.connectors.api import ParamFilter [as 别名]
# 或者: from fedoracommunity.connectors.api.ParamFilter import add_filter [as 别名]
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
示例9: register_query_conflicts
# 需要导入模块: from fedoracommunity.connectors.api import ParamFilter [as 别名]
# 或者: from fedoracommunity.connectors.api.ParamFilter import add_filter [as 别名]
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
示例10: register_query_obsoletes
# 需要导入模块: from fedoracommunity.connectors.api import ParamFilter [as 别名]
# 或者: from fedoracommunity.connectors.api.ParamFilter import add_filter [as 别名]
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
示例11: register_query_problems
# 需要导入模块: from fedoracommunity.connectors.api import ParamFilter [as 别名]
# 或者: from fedoracommunity.connectors.api.ParamFilter import add_filter [as 别名]
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
示例12: register_query_bugs
# 需要导入模块: from fedoracommunity.connectors.api import ParamFilter [as 别名]
# 或者: from fedoracommunity.connectors.api.ParamFilter import add_filter [as 别名]
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
示例13: register_query_updates
# 需要导入模块: from fedoracommunity.connectors.api import ParamFilter [as 别名]
# 或者: from fedoracommunity.connectors.api.ParamFilter import add_filter [as 别名]
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,
#.........这里部分代码省略.........
示例14: register_query_usermemberships
# 需要导入模块: from fedoracommunity.connectors.api import ParamFilter [as 别名]
# 或者: from fedoracommunity.connectors.api.ParamFilter import add_filter [as 别名]
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
示例15: register_query_userpackages
# 需要导入模块: from fedoracommunity.connectors.api import ParamFilter [as 别名]
# 或者: from fedoracommunity.connectors.api.ParamFilter import add_filter [as 别名]
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