__init__.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:lagendacommun 作者: ecreall 项目源码 文件源码
def evolve_alerts(root, registry):
    from lac.views.filter import find_entities
    from lac.content.interface import IAlert
    from substanced.util import get_oid

    contents = find_entities(interfaces=[IAlert])
    len_entities = str(len(contents))
    for index, alert in enumerate(contents):
        alert.users_to_alert = PersistentList(
            [str(get_oid(user, user))
             for user in alert.users_to_alert])
        alert.reindex()
        if index % 1000 == 0:
            log.info("**** Commit ****")
            transaction.commit()

        log.info(str(index) + "/" + len_entities)

    log.info('Alerts reindexed')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号