1 2 3 4 5 6 7 8 9 10 11 | def accept_selected(self, request, queryset):
n = queryset.count()
for review in queryset:
review.accept()
self.message_user(request, _("Successfully accepted %(count)d %(items)s.") % {
"count": n, "items": model_ngettext(self.opts, n)
})
# the next line is the one you'll be interested in
return HttpResponseRedirect(request.get_full_path())
accept_selected.short_description = "Accept Selected Reviews"
|
More like this
- View all log entries in the admin by jakub 7 months ago
- Save Admin ChangeList Filter by msaron 4 weeks, 1 day ago
- FilterSpec for ForeignKeys to auth.User with HTML input tag for ModelAdmin.list_filter by loic 9 months, 1 week ago
- Return to a filtered changelist on change form save by richardbolt 1 year, 6 months ago
- Manager introspecting attached model by ubernostrum 3 years, 11 months ago
Comments
The indentation for line 11 is probably wrong.
#