You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
547 B
20 lines
547 B
|
|
def get_ballances(user):
|
|
res = {}
|
|
if user:
|
|
for wallet in user.wallet_set.all():
|
|
info = '%.8f' % wallet.amount
|
|
if wallet.amount_blocked:
|
|
info += ' (%.8f)' % wallet.amount_blocked
|
|
res[wallet.currency.iso] = info
|
|
return res
|
|
|
|
|
|
def get_ballances_decimal(user):
|
|
res = {}
|
|
if user:
|
|
for wallet in user.wallet_set.all():
|
|
info = wallet.amount
|
|
blocked = wallet.amount_blocked
|
|
res[wallet.currency.iso] = (info, blocked)
|
|
return res
|
|
|