diff options
-rw-r--r-- | main/models.py | 1 | ||||
-rw-r--r-- | packages/views.py | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/main/models.py b/main/models.py index 6235152..bc23629 100644 --- a/main/models.py +++ b/main/models.py @@ -195,6 +195,7 @@ class Package(models.Model): class Meta: db_table = 'packages' get_latest_by = 'last_update' + ordering = ('-last_update',) def __str__(self): return self.pkgname diff --git a/packages/views.py b/packages/views.py index cb6bb81..2a77be5 100644 --- a/packages/views.py +++ b/packages/views.py @@ -106,7 +106,7 @@ def search(request, query=''): # sort results if sort == '': - results = results.order_by('repo', 'arch', 'pkgname') + results = results.order_by('repo', 'arch', '-last_update', 'pkgname') else: # duplicate sort fields shouldn't hurt anything results = results.order_by(sort, 'repo', 'arch', 'pkgname') |