From 7d2e5948b202973efa69fc30859ddbe0ff9b00b1 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Tue, 23 Apr 2013 23:27:02 -0400 Subject: fixed bug in details views --- app/links/detail_urls.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'app/links') diff --git a/app/links/detail_urls.py b/app/links/detail_urls.py index 2b6ec5d..b629f3e 100644 --- a/app/links/detail_urls.py +++ b/app/links/detail_urls.py @@ -1,13 +1,14 @@ -from django.conf.urls.defaults import * -from django.views.generic.simple import redirect_to +from django.conf.urls import * +from django.views.generic.base import RedirectView +from django.views.generic.detail import DetailView from links.models import Link detail_dict = { 'queryset': Link.objects.filter(status__exact=1), } -urlpatterns = patterns('django.views.generic.list_detail', - (r'^$', redirect_to, {'url': '/links/1/'}), - (r'^(?P\d+)/$', 'object_detail', dict(detail_dict, template_name='details/link.html')), +urlpatterns = patterns('', + (r'^$', RedirectView.as_view(url="/links/1/")), + (r'^(?P\d+)/$', DetailView.as_view(model=Link,template_name='details/link.html')), ) -- cgit v1.2.3-70-g09d2