예제 #1
0
def format_history(histories):
    history_list = []
    trans = MigrateDal.get_isp_trans()
    for history in histories:
        history_list.append({
            'id':
            history.id,
            'migrate_rooms':
            sorted(json.loads(history.migrate_rooms)),
            'dst_rooms':
            sorted(json.loads(history.dst_rooms)),
            'migrate_isps':
            sorted([trans[isp] for isp in json.loads(history.migrate_isps)]),
            'cur':
            history.cur,
            'all':
            history.all,
            'state':
            history.state,
            'rtx_id':
            history.rtx_id,
            'update_at':
            history.updated_time.strftime('%Y-%m-%d %H:%M:%S')
        })
    return history_list
예제 #2
0
def format_history(histories):
    history_list = []
    trans = MigrateDal.get_isp_trans()
    for history in histories:
        history_list.append({
            'id': history.id,
            'migrate_rooms': sorted(json.loads(history.migrate_rooms)),
            'dst_rooms': sorted(json.loads(history.dst_rooms)),
            'migrate_isps': sorted([trans[isp] for isp in json.loads(history.migrate_isps)]),
            'cur': history.cur,
            'all': history.all,
            'state': history.state,
            'rtx_id': history.rtx_id,
            'update_at': history.updated_time.strftime('%Y-%m-%d %H:%M:%S')
        })
    return history_list
예제 #3
0
파일: preview.py 프로젝트: znavy/open_dnsdb
def get_previewinfo():
    trans = MigrateDal.get_isp_trans()
    domain_count = ViewRecordDal.zone_domain_count()
    migrate_list = []
    histories = MigrateDal.get_migrated_history()
    for history in histories:
        migrate_list.append({
            'migrate_rooms': sorted(json.loads(history.migrate_rooms)),
            'dst_rooms': sorted(json.loads(history.dst_rooms)),
            'migrate_isps': sorted([trans[isp] for isp in json.loads(history.migrate_isps)])
        })

    migrate_acl_subnet = ViewIspAclDal.get_migrate_subnet()

    return {'domain_count': domain_count,
            'migrate': migrate_list,
            'acl_migrate': migrate_acl_subnet}