brmbar v3 UserMgmt: New view with list of users and their balances

This commit is contained in:
Petr Baudis 2012-09-24 03:55:39 +02:00
parent 99cbefbb21
commit 1d64e17a54
4 changed files with 125 additions and 3 deletions

View file

@ -80,6 +80,10 @@ class ShopAdapter(QtCore.QObject):
def balance_credit(self):
return shop.credit_negbalance_str()
@QtCore.Slot(result='QVariant')
def userList(self):
return [ self.acct_debt_map(a) for a in shop.account_list("debt") ]
db = psycopg2.connect("dbname=brmbar")
shop = brmbar.Shop.new_with_defaults(db)
currency = shop.currency