diff options
author | Dan McGee <dan@archlinux.org> | 2011-06-23 20:13:01 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-06-23 20:13:01 -0500 |
commit | dcbb859a259082bf8d0587a63385ece44c697e45 (patch) | |
tree | 1ef16b20f111709c4144d2445840e659485412e8 /packages/views.py | |
parent | 82289ebb4432b3372b959430581afa0a2158acb9 (diff) |
Add (hidden) ability to search by last packager
This is used from the developer dashboard to add a new column to the
stats of # of packages for a given developer where they were the last to
do the packaging.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages/views.py')
-rw-r--r-- | packages/views.py | 10 |
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': |