美文网首页
导admin_user

导admin_user

作者: JoneSnow | 来源:发表于2018-05-24 14:53 被阅读9次

    from asura.model.user import AdminUser
    f = open('result.csv', 'w')
    last_id = '54732c57d6e4a91fb166b3f5'
    aus = AdminUser.objects(id__gte=last_id)
    while aus:
    for u in aus:
    last_id = str(u.id)
    s = u.real_name + ',' + u.department + ',' + u.email + ','
    r = u.roles
    if 'op_junior' in r:
    s += '1'
    else:
    s += '0'
    s += ','
    if 'op_editor' in r:
    s += '1'
    else:
    s += '0'
    s += ','
    if 'op_review' in r:
    s += '1'
    else:
    s += '0'
    s += ','
    if 'op_review_sensitive' in r:
    s += '1'
    else:
    s += '0'
    s += ','
    if 'op_category' in r:
    s += '1'
    else:
    s += '0'
    s += ','
    if 'op_note_reviewer' in r:
    s += '1'
    else:
    s += '0'
    s += ',' + str(u.user.id) + ','
    if u.passwdhash:
    s += w.passwdhash
    s += '\n'
    f.write(s.encode('utf-8'))
    aus = AdminUser.objects(id__gt=last_id)

    相关文章

      网友评论

          本文标题:导admin_user

          本文链接:https://www.haomeiwen.com/subject/jtdsjftx.html