summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/views.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/views.py b/packages/views.py
index 7b8c2e67..02b9f93b 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -191,6 +191,7 @@ class PackageSearchForm(forms.Form):
arch = forms.MultipleChoiceField(required=False)
q = forms.CharField(required=False)
maintainer = forms.ChoiceField(required=False)
+ packager = forms.ChoiceField(required=False)
last_update = forms.DateField(required=False, widget=AdminDateWidget(),
label='Last Updated After')
flagged = forms.ChoiceField(
@@ -213,6 +214,9 @@ class PackageSearchForm(forms.Form):
self.fields['maintainer'].choices = \
[('', 'All'), ('orphan', 'Orphan')] + \
[(m.username, m.get_full_name()) for m in maints]
+ self.fields['packager'].choices = \
+ [('', 'All'), ('unknown', 'Unknown')] + \
+ [(m.username, m.get_full_name()) for m in maints]
def search(request, page=None):
limit = 50
@@ -237,6 +241,12 @@ def search(request, page=None):
user__username=form.cleaned_data['maintainer']).values('pkgbase')
packages = packages.filter(pkgbase__in=inner_q)
+ if form.cleaned_data['packager'] == 'unknown':
+ packages = packages.filter(packager__isnull=True)
+ elif form.cleaned_data['packager']:
+ packages = packages.filter(
+ packager__username=form.cleaned_data['packager'])
+
if form.cleaned_data['flagged'] == 'Flagged':
packages = packages.filter(flag_date__isnull=False)
elif form.cleaned_data['flagged'] == 'Not Flagged':