本文整理汇总了Python中aleph.model.Entity.all_ids方法的典型用法代码示例。如果您正苦于以下问题:Python Entity.all_ids方法的具体用法?Python Entity.all_ids怎么用?Python Entity.all_ids使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aleph.model.Entity
的用法示例。
在下文中一共展示了Entity.all_ids方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
# 需要导入模块: from aleph.model import Entity [as 别名]
# 或者: from aleph.model.Entity import all_ids [as 别名]
def test():
from aleph.model import Entity
graph = get_graph()
tx = graph.begin()
for entity_id in Entity.all_ids():
remove_entity(tx, entity_id)
tx.commit()
示例2: all
# 需要导入模块: from aleph.model import Entity [as 别名]
# 或者: from aleph.model.Entity import all_ids [as 别名]
def all():
collection_id = request.args.getlist('collection_id')
collection_id = authz.collections_intersect(authz.READ, collection_id)
q = Entity.all_ids()
q = q.filter(Entity.state == Entity.STATE_ACTIVE)
q = q.filter(Entity.deleted_at == None) # noqa
clause = Collection.id.in_(collection_id)
q = q.filter(Entity.collections.any(clause))
return jsonify({'results': [r[0] for r in q]})
示例3: all
# 需要导入模块: from aleph.model import Entity [as 别名]
# 或者: from aleph.model.Entity import all_ids [as 别名]
def all():
q = Entity.all_ids()
clause = Collection.id.in_(authz.collections(authz.READ))
q = q.filter(Entity.collections.any(clause))
results = [r[0] for r in q.all()]
return jsonify({'results': results, 'total': len(results)})