#NEWLINE# def total_balance( currency , exclude_ids = None ) : #NEWLINE# #INDENT# 'Returns the total balance of the system' #NEWLINE# qs = models . Wallet . objects . filter ( balance_currency = currency ) #NEWLINE# if ( qs is not None ) : #NEWLINE# #INDENT# qs = qs . exclude ( owner_id__in = exclude_ids ) #NEWLINE# #UNINDENT# return qs . sum ( currency )