1 # -*- coding: utf-8 -*-
2 from django.conf.urls import url
3 from django.contrib import admin
4 from django.http.response import HttpResponse
6 from newsletter.models import Subscription
9 class SubscriptionAdmin(admin.ModelAdmin):
11 urls = super(SubscriptionAdmin, self).get_urls()
13 url(r'^extract/$', self.extract_subscribers, name='extract_subscribers'),
17 def extract_subscribers(self, request):
18 return HttpResponse(',\n'.join(Subscription.objects.values_list('email', flat=True)), content_type='text/plain')
21 admin.site.register(Subscription, SubscriptionAdmin)