diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-04-13 21:00:49 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-04-13 21:00:49 -0400 |
commit | 7aab774ad05b81eb204774bf17cc613401310f7b (patch) | |
tree | 812929abb2ae6fae90e6a56d4237738d7ca62a8f /packages/views | |
parent | 355087ebe2e3fbd5f860e4655888a89d9df52e34 (diff) | |
parent | c266efc7fc73f94995bffcdf8e0ef7a4aeb563c3 (diff) |
Merge tag 'release_2014-10-19' into archweb-generic
Jinja2 switch for some templates, exact matches in package search
# Conflicts:
# templates/packages/search.html
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']: |