Commit a55ab7de authored by Johannes Löthberg's avatar Johannes Löthberg Committed by Jelle van der Waa
Browse files

Add support for searching by package provides

Signed-off-by: Johannes Löthberg's avatarJohannes Löthberg <>
parent 4443a1c1
......@@ -106,9 +106,17 @@ def parse_form(form, packages):
(Q(pkgname__icontains=q) for q in query.split()))
q_pkgdesc = reduce(operator.__and__,
(Q(pkgdesc__icontains=q) for q in query.split()))
packages = packages.filter(q_pkgname | q_pkgdesc)
qs_provide = []
for query_term in query.split():
term_parts = query_term.rsplit('=', 2)
if len(term_parts) == 2:
q_provides = reduce(operator.__and__, qs_provide)
return packages
packages = packages.filter(q_pkgname | q_pkgdesc | q_provides)
return packages.distinct()
class SearchListView(ListView):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment