bodhi/controllers.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
New commits:
commit 54bbad06c28529d8b02ce8a4b67172b6c8b706bc
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Oct 9 19:09:28 2008 -0400
Order our list query results by the date_submitted
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 482e76a..c8c40e8 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -186,13 +186,13 @@ class Root(controllers.RootController):
log.debug('list(%s)' % locals())
query = []
updates = []
+ orderBy = PackageUpdate.q.date_submitted
# If no arguments are specified, return the most recent updates
if not release and not bugs and not cves and not status and not type_ \
and not package and not mine and not username:
log.debug("No arguments, returning latest")
- updates = PackageUpdate.select(
- orderBy=PackageUpdate.q.date_submitted).reversed()
+ updates = PackageUpdate.select(orderBy=orderBy).reversed()
num_items = updates.count()
return dict(updates=updates, num_items=num_items,
title="%d %s found" % (num_items, num_items == 1 and
@@ -217,7 +217,8 @@ class Root(controllers.RootController):
if username:
query.append(PackageUpdate.q.submitter == username)
- updates = PackageUpdate.select(AND(*query))
+ updates = PackageUpdate.select(AND(*query),
+ orderBy=orderBy).reversed()
# The package argument may be an update, build or package.
if package:
Show replies by date