diff options
author | luxagraf <sng@luxagraf.net> | 2015-11-06 23:09:56 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2015-11-06 23:09:56 -0500 |
commit | dbb8c23a81361b2bdd1128c997c8ce74a0cb4bd7 (patch) | |
tree | 05496f5684b216565dd8ebb6e18e1c7eddc96638 /app/src/urls.py | |
parent | 78dc05f455f234da32c8c4d60b1b074755758d1c (diff) |
refactored src to use new build system with CBVs
Diffstat (limited to 'app/src/urls.py')
-rw-r--r-- | app/src/urls.py | 65 |
1 files changed, 50 insertions, 15 deletions
diff --git a/app/src/urls.py b/app/src/urls.py index a2368e3..217912c 100644 --- a/app/src/urls.py +++ b/app/src/urls.py @@ -1,17 +1,52 @@ -from django.conf.urls import * -from django.views.generic import ListView +from django.conf.urls import url, include -from .models import Entry, Book +from . import views -urlpatterns = patterns('', - (r'topic/(?P<slug>[-\w]+)/$', 'src.views.topic'), - (r'books/$', ListView.as_view( - queryset=Book.objects.filter(status__exact=1).order_by('-pub_date'), - template_name="archives/src_books.html", - )), - (r'(?P<slug>[-\w]+)/$', 'src.views.detail'), - (r'^$', ListView.as_view( - queryset=Entry.objects.filter(status__exact=1).order_by('-pub_date'), - template_name="archives/src_home.html", - )), -) + +urlpatterns = [ + url( + regex=r'^feed.xml', + view=views.SrcRSSFeedView(), + name="feed" + ), + url( + r'^something/paypal/', + include('paypal.standard.ipn.urls'), + name="paypal-ipn" + ), + url( + regex=r'topic/(?P<slug>[-\w]+)$', + view=views.TopicListView.as_view(), + name="list_topics" + ), + url( + regex=r'books/(?P<slug>[-\w]+)$', + view=views.BookDetailView.as_view(), + name='detail_book' + ), + url( + regex=r'books/$', + view=views.BookListView.as_view(), + name='list_books' + ), + url( + regex=r'(?P<slug>[-\w]+).txt$', + view=views.EntryDetailViewTXT.as_view(), + name="detail-txt" + ), + url( + regex=r'(?P<slug>[-\w]+).amp$', + view=views.EntryDetailViewAMP.as_view(), + name="detail-amp" + ), + url( + regex=r'(?P<slug>[-\w]+)$', + view=views.EntryDetailView.as_view(), + name="detail" + ), + url( + regex=r'^$', + view=views.SrcListView.as_view(), + name="list", + ), +] |