Skip to content

Commit

Permalink
version_rank and aliases used for sorting
Browse files Browse the repository at this point in the history
Signed-off-by: NucleonGodX <[email protected]>
  • Loading branch information
NucleonGodX committed Jan 28, 2025
1 parent 08370a1 commit c52d92a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vulnerabilities/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
class PackageSearch(ListView):
model = models.Package
template_name = "packages.html"
ordering = ["type", "namespace", "name", "version"]
ordering = ["type", "namespace", "name", "-version_rank"]
paginate_by = PAGE_SIZE

def get_context_data(self, **kwargs):
Expand All @@ -62,7 +62,7 @@ def get_queryset(self, query=None):
self.model.objects.search(query)
.with_vulnerability_counts()
.prefetch_related()
.order_by("type", "namespace", "name", "-version")
.order_by("type", "namespace", "name", "-version_rank")
)


Expand Down

0 comments on commit c52d92a

Please sign in to comment.