From 49e084189db88dc2b7aaa492014e22fc2d276dca Mon Sep 17 00:00:00 2001 From: Hidden Z Date: Thu, 17 Feb 2011 19:07:21 +0000 Subject: [PATCH] pyi2phosts/postkey/admin.py: add admin action "Approve selected" --- pyi2phosts/postkey/admin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyi2phosts/postkey/admin.py b/pyi2phosts/postkey/admin.py index 25c513e..e5008d6 100644 --- a/pyi2phosts/postkey/admin.py +++ b/pyi2phosts/postkey/admin.py @@ -45,9 +45,12 @@ class PendingAdmin(i2phostAdmin): qs = super(PendingAdmin, self).queryset(request) return qs.filter(approved=False) + def approve_selected(modeladmin, request, queryset): + queryset.update(approved=True) + list_filter = [] list_display = ('url', 'name', 'description', 'date_added', 'last_seen', 'expires', 'approved') - list_editable = ['approved'] + actions = ['approve_selected'] admin.site.register(i2phost, i2phostAdmin)