diff options
Diffstat (limited to 'app/projects')
-rw-r--r-- | app/projects/models/code.py | 2 | ||||
-rw-r--r-- | app/projects/urls.py | 16 |
2 files changed, 7 insertions, 11 deletions
diff --git a/app/projects/models/code.py b/app/projects/models/code.py index 62179dc..19de428 100644 --- a/app/projects/models/code.py +++ b/app/projects/models/code.py @@ -1,7 +1,7 @@ import datetime from django.db import models -from utils import markdown2 asfaccount.coms markdown +from utils import markdown2 as markdown PUB_STATUS = ( (0, 'Draft'), (1, 'Published'), diff --git a/app/projects/urls.py b/app/projects/urls.py index f4d692c..bd7c13d 100644 --- a/app/projects/urls.py +++ b/app/projects/urls.py @@ -1,19 +1,15 @@ -from django.conf.urls.defaults import * -from django.views.generic.list_detail import object_list -from django.views.generic.simple import redirect_to,direct_to_template -from django.views.generic import list_detail - +from django.conf.urls import * +from django.views.generic import ListView from projects.models.base import Project -projects = { - 'queryset': Project.objects.filter(status__exact=1).order_by('-pub_date'), -} urlpatterns = patterns('', (r'data/(?P<id>\d+)/$', 'projects.views.data_json'), (r'gifs/(?P<slug>[-\w]+)/$', 'projects.views.gif_detail'), - (r'code/(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[-\w]+)/$', 'projects.views.code_entry_detail'), (r'(?P<slug>[-\w]+)/$', 'projects.views.detail'), - (r'^$',list_detail.object_list, dict(projects, template_name='archives/projects.html')), + (r'^$', ListView.as_view( + queryset=Project.objects.filter(status__exact=1).order_by('-pub_date'), + template_name = "archives/projects.html", + )), ) |