Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
719 B
2
Indexable
Never
def wallet_dt_modifier(dt):
    for f_ls in dt["Message"]:
        new_dt.update({'email':f_ls['email'],'total_tickets_based_on_balance':f_ls['wallets'][0]['total_tickets_based_on_balance'],'total_balance':f_ls['total_balance'],'eligibility_flag':f_ls['eligibility_flag']})
        wal_ls = []
        for _, wal in enumerate(f_ls['wallets']):
            if _ == 0:
                wal.update({"master_wallet":'true'})
            else:
                wal.update({"master_wallet":'false'})
            print(wal)
            del wal['total_tickets_based_on_balance']
            del wal['eligibility']
            wal_ls.append(wal)
        new_dt.update({'wallets':wal_ls})
    dt["Message"] = [new_dt]