def handle(self, *args, **options): with transaction.atomic(): counts = [{'name': str(x['name']), 'count': len(x['entries'])} for x in get_all_pending_moderations()] if len(counts): # Generate an email and send it off send_template_mail(settings.NOTIFICATION_FROM, settings.NOTIFICATION_EMAIL, "PostgreSQL moderation report: %s" % datetime.now(), "core/moderation_report.txt", { 'items': counts, })
def admin_pending(request): return render_to_response('core/admin_pending.html', { 'app_list': get_all_pending_moderations(), }, RequestContext(request))
def admin_pending(request): return render(request, 'core/admin_pending.html', { 'app_list': get_all_pending_moderations(), })
def admin_pending(request): return render_to_response( "core/admin_pending.html", {"app_list": get_all_pending_moderations()}, RequestContext(request) )