Mercurial > public > sg101
changeset 311:b1c39788e511
Fix #146; use new class-based generic views as function-based generic views are now deprecated.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 20 Jan 2011 04:40:14 +0000 (2011-01-20) |
parents | daa2916f5b34 |
children | 88b2b9cb8c1f |
files | gpp/donations/urls.py gpp/messages/urls.py |
diffstat | 2 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/gpp/donations/urls.py Thu Jan 20 04:03:48 2011 +0000 +++ b/gpp/donations/urls.py Thu Jan 20 04:40:14 2011 +0000 @@ -2,12 +2,13 @@ URLs for the donations application. """ from django.conf.urls.defaults import * +from django.views.generic import TemplateView urlpatterns = patterns('donations.views', url(r'^$', 'index', name='donations-index'), url(r'^ipn/$', 'ipn', name='donations-ipn'), ) -urlpatterns += patterns('django.views.generic.simple', - (r'^thanks/$', 'direct_to_template', - {'template': 'donations/thanks.html'}, 'donations-thanks') +urlpatterns += patterns('', + url(r'^thanks/$', TemplateView.as_view(template_name='donations/thanks.html'), + name='donations-thanks'), )
--- a/gpp/messages/urls.py Thu Jan 20 04:03:48 2011 +0000 +++ b/gpp/messages/urls.py Thu Jan 20 04:40:14 2011 +0000 @@ -1,5 +1,6 @@ """urls for the Messages application""" from django.conf.urls.defaults import * +from django.views.generic import RedirectView urlpatterns = patterns('messages.views', url(r'^inbox/$', 'inbox', name='messages-inbox'), @@ -16,7 +17,7 @@ url(r'^options/$', 'options', name='messages-options'), ) -urlpatterns += patterns('django.views.generic.simple', - (r'^$', 'redirect_to', {'url': 'inbox/'}), +urlpatterns += patterns('', + (r'^$', RedirectView.as_view(url='inbox/')), )