Browse Source

pyi2phosts/postkey/admin.py: add admin action "Approve selected"

pull/1/head
Hidden Z 14 years ago
parent
commit
49e084189d
  1. 5
      pyi2phosts/postkey/admin.py

5
pyi2phosts/postkey/admin.py

@ -45,9 +45,12 @@ class PendingAdmin(i2phostAdmin):
qs = super(PendingAdmin, self).queryset(request) qs = super(PendingAdmin, self).queryset(request)
return qs.filter(approved=False) return qs.filter(approved=False)
def approve_selected(modeladmin, request, queryset):
queryset.update(approved=True)
list_filter = [] list_filter = []
list_display = ('url', 'name', 'description', 'date_added', 'last_seen', 'expires', 'approved') list_display = ('url', 'name', 'description', 'date_added', 'last_seen', 'expires', 'approved')
list_editable = ['approved'] actions = ['approve_selected']
admin.site.register(i2phost, i2phostAdmin) admin.site.register(i2phost, i2phostAdmin)

Loading…
Cancel
Save