Mercurial > hg > ltpdarepo
changeset 181:342125a26ff1
Add ordering to tables in user views.
author | Daniele Nicolodi <daniele@grinta.net> |
---|---|
date | Tue, 08 Nov 2011 11:28:39 +0100 |
parents | c88f216f1830 |
children | 2c1253e826cc |
files | src/ltpdarepo/views/users.py |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ltpdarepo/views/users.py Tue Nov 08 11:04:15 2011 +0100 +++ b/src/ltpdarepo/views/users.py Tue Nov 08 11:28:39 2011 +0100 @@ -24,7 +24,7 @@ curs = g.db.cursor(DictCursor) curs.execute("""SELECT username, email, CONCAT(given_name, ' ', family_name) AS name - FROM users""") + FROM users ORDER BY username""") users = curs.fetchall() return render_template('users/index.html', users=users) @@ -40,8 +40,8 @@ privs = {} curs = g.db.cursor() - curs.execute('''SELECT DISTINCT Db, Select_priv, Insert_priv, - Update_priv, Delete_priv FROM mysql.db WHERE User=%s''', username) + curs.execute("""SELECT DISTINCT Db, Select_priv, Insert_priv, Update_priv, Delete_priv + FROM mysql.db WHERE User=%s ORDER BY Db""", username) for row in curs.fetchall(): privs[row[0]] = {'select': row[1] == 'Y', 'insert': row[2] == 'Y',