comparison email_list/admin.py @ 180:312f198e8958

Changes for Django 1.8.
author Brian Neal <bgneal@gmail.com>
date Sun, 13 Dec 2015 21:04:43 -0600
parents e2868ad47a1e
children
comparison
equal deleted inserted replaced
179:574cdd0241af 180:312f198e8958
1 """ 1 """
2 Automatic admin definitions for the email_list application. 2 Automatic admin definitions for the email_list application.
3 3
4 """ 4 """
5 from django.contrib import admin 5 from django.contrib import admin
6 from django.conf.urls import patterns, url 6 from django.conf.urls import url
7 from django.shortcuts import render, redirect 7 from django.shortcuts import render, redirect
8 8
9 from email_list.models import Subscriber 9 from email_list.models import Subscriber
10 from email_list.forms import AdminEmailForm 10 from email_list.forms import AdminEmailForm
11 11
15 list_filter = ['status'] 15 list_filter = ['status']
16 search_fields = ['name', 'email'] 16 search_fields = ['name', 'email']
17 17
18 def get_urls(self): 18 def get_urls(self):
19 urls = super(SubscriberAdmin, self).get_urls() 19 urls = super(SubscriberAdmin, self).get_urls()
20 my_urls = patterns('', 20 my_urls = [
21 url(r'^send_mail/$', 21 url(r'^send_mail/$',
22 self.admin_site.admin_view(self.send_mail), 22 self.admin_site.admin_view(self.send_mail),
23 name='email_list-admin_mail'), 23 name='email_list-admin_mail'),
24 ) 24 ]
25 return my_urls + urls 25 return my_urls + urls
26 26
27 def send_mail(self, request): 27 def send_mail(self, request):
28 if request.method == 'POST': 28 if request.method == 'POST':
29 form = AdminEmailForm(request.POST) 29 form = AdminEmailForm(request.POST)