diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-04-13 20:25:24 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-04-13 20:25:24 -0400 |
commit | c266efc7fc73f94995bffcdf8e0ef7a4aeb563c3 (patch) | |
tree | 2b96d2ff0f7e0a0d164a28b152b51fbb2f87b76f /packages/views | |
parent | ea00a099dffd7157c93af54b5817734348d2bbc6 (diff) | |
parent | 9589a7eadeb05e82c2d63f6fe128316fdb6dcc8a (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.py | 6 |
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']: |