# HG changeset patch # User Daniele Nicolodi # Date 1320748119 -3600 # Node ID 342125a26ff11494a0b137ae7fbccaedf0440ad5 # Parent c88f216f1830ecdb6dc41eba5c34f2ccc27d0b45 Add ordering to tables in user views. diff -r c88f216f1830 -r 342125a26ff1 src/ltpdarepo/views/users.py --- 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',