summaryrefslogtreecommitdiff
path: root/packages/views
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-04-13 20:25:24 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-04-13 20:25:24 -0400
commitc266efc7fc73f94995bffcdf8e0ef7a4aeb563c3 (patch)
tree2b96d2ff0f7e0a0d164a28b152b51fbb2f87b76f /packages/views
parentea00a099dffd7157c93af54b5817734348d2bbc6 (diff)
parent9589a7eadeb05e82c2d63f6fe128316fdb6dcc8a (diff)
Merge tag 'release_2014-10-19' into archweb-generic
Jinja2 switch for some templates, exact matches in package search
Diffstat (limited to 'packages/views')
-rw-r--r--packages/views/search.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/views/search.py b/packages/views/search.py
index b3778172..0b776d79 100644
--- a/packages/views/search.py
+++ b/packages/views/search.py
@@ -45,6 +45,12 @@ class PackageSearchForm(forms.Form):
[('', 'All'), ('unknown', 'Unknown')] + \
[(m.username, m.get_full_name()) for m in maints]
+ def exact_matches(self):
+ # only do exact match search if 'q' is sole parameter
+ if self.changed_data != ['q']:
+ return []
+ return Package.objects.normal().filter(pkgname=self.cleaned_data['q'])
+
def parse_form(form, packages):
if form.cleaned_data['repo']: