brmbar.Shop.account_list(): Sort accounts alphabetically

This commit is contained in:
Petr Baudis 2012-09-25 00:13:58 +02:00
parent 0645e6c9b0
commit 586b2411cf

View file

@ -104,7 +104,7 @@ class Shop:
def account_list(self, acctype):
accts = []
with closing(self.db.cursor()) as cur:
cur.execute("SELECT id FROM accounts WHERE acctype = %s", [acctype])
cur.execute("SELECT id FROM accounts WHERE acctype = %s ORDER BY name ASC", [acctype])
for inventory in cur:
accts += [ Account.load(self.db, id = inventory[0]) ]
return accts