本文整理汇总了Python中aleph.model.Entity.by_lists方法的典型用法代码示例。如果您正苦于以下问题:Python Entity.by_lists方法的具体用法?Python Entity.by_lists怎么用?Python Entity.by_lists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aleph.model.Entity
的用法示例。
在下文中一共展示了Entity.by_lists方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: index
# 需要导入模块: from aleph.model import Entity [as 别名]
# 或者: from aleph.model.Entity import by_lists [as 别名]
def index():
watchlist_ids = authz.watchlists(authz.READ)
filter_lists = request.args.getlist("watchlist")
if len(filter_lists):
try:
filter_lists = [int(f) for f in filter_lists]
watchlist_ids = [l for l in watchlist_ids if l in filter_lists]
except ValueError:
raise BadRequest()
prefix = request.args.get("prefix")
q = Entity.by_lists(watchlist_ids, prefix=prefix)
return jsonify(Pager(q))
示例2: index
# 需要导入模块: from aleph.model import Entity [as 别名]
# 或者: from aleph.model.Entity import by_lists [as 别名]
def index():
list_ids = List.user_list_ids(current_user)
filter_lists = request.args.getlist("list")
if len(filter_lists):
try:
filter_lists = [int(f) for f in filter_lists]
list_ids = [l for l in list_ids if l in filter_lists]
except ValueError:
raise BadRequest()
prefix = request.args.get("prefix")
q = Entity.by_lists(list_ids, prefix=prefix)
return jsonify(Pager(q))
示例3: index
# 需要导入模块: from aleph.model import Entity [as 别名]
# 或者: from aleph.model.Entity import by_lists [as 别名]
def index():
collection_ids = match_ids('collection', authz.collections(authz.READ))
q = Entity.by_lists(collection_ids, prefix=request.args.get('prefix'))
return jsonify(Pager(q))