mirror of
https://github.com/brmlab/brmbar.git
synced 2025-06-08 05:14:00 +02:00
brmbar.Shop.account_list(): New query method
This commit is contained in:
parent
025d8f4d5d
commit
71abc6ca66
1 changed files with 8 additions and 0 deletions
|
@ -94,3 +94,11 @@ class Shop:
|
|||
return balance
|
||||
def inventory_negbalance_str(self):
|
||||
return self.currency.str(-self.inventory_balance())
|
||||
|
||||
def account_list(self, acctype):
|
||||
accts = []
|
||||
with closing(self.db.cursor()) as cur:
|
||||
cur.execute("SELECT id FROM accounts WHERE acctype = %s", ["debt"])
|
||||
for inventory in cur:
|
||||
accts += [ Account.load(self.db, id = inventory[0]) ]
|
||||
return accts
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue