summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-03-03 12:31:58 -0600
committerDan McGee <dan@archlinux.org>2011-03-03 12:33:48 -0600
commit3a85ead4475b8acfa236a5b1825b844d0431bbaf (patch)
tree714f79506a46b935f0f71f76c19693160f6535ec /packages
parent95a71576d2381b87916645b169fbc39898c250b3 (diff)
Make Arch and Repo a MultipleChoice on package search
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages')
-rw-r--r--packages/views.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/views.py b/packages/views.py
index 1ab04258..7c57d88a 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -127,8 +127,8 @@ def getmaintainer(request, name, repo, arch):
return HttpResponse(str('\n'.join(names)), mimetype='text/plain')
class PackageSearchForm(forms.Form):
- repo = forms.ChoiceField(required=False)
- arch = forms.ChoiceField(required=False)
+ repo = forms.MultipleChoiceField(required=False)
+ arch = forms.MultipleChoiceField(required=False)
q = forms.CharField(required=False)
maintainer = forms.ChoiceField(required=False)
last_update = forms.DateField(required=False, widget=AdminDateWidget(),
@@ -157,9 +157,9 @@ class PackageSearchForm(forms.Form):
def __init__(self, *args, **kwargs):
super(PackageSearchForm, self).__init__(*args, **kwargs)
- self.fields['repo'].choices = [('', 'All')] + make_choice(
+ self.fields['repo'].choices = make_choice(
[repo.name for repo in Repo.objects.all()])
- self.fields['arch'].choices = [('', 'All')] + make_choice(
+ self.fields['arch'].choices = make_choice(
[arch.name for arch in Arch.objects.all()])
self.fields['q'].widget.attrs.update({"size": "30"})
maints = User.objects.filter(is_active=True).order_by('username')
@@ -178,11 +178,11 @@ def search(request, page=None):
if form.is_valid():
if form.cleaned_data['repo']:
packages = packages.filter(
- repo__name=form.cleaned_data['repo'])
+ repo__name__in=form.cleaned_data['repo'])
if form.cleaned_data['arch']:
packages = packages.filter(
- arch__name=form.cleaned_data['arch'])
+ arch__name__in=form.cleaned_data['arch'])
if form.cleaned_data['maintainer'] == 'orphan':
inner_q = PackageRelation.objects.all().values('pkgbase')