summaryrefslogtreecommitdiff
path: root/app/links/urls.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/links/urls.py')
-rw-r--r--app/links/urls.py48
1 files changed, 35 insertions, 13 deletions
diff --git a/app/links/urls.py b/app/links/urls.py
index fa8e042..5fdaf30 100644
--- a/app/links/urls.py
+++ b/app/links/urls.py
@@ -1,15 +1,37 @@
-from django.conf.urls import *
-from django.views.generic import list_detail
-from django.views.generic.simple import redirect_to
-from links.models import Link
+from django.conf.urls import url
+from django.views.generic.base import RedirectView
-photos_paged = {
- 'queryset': Link.objects.filter(status__exact=1).order_by('-pub_date'),
- 'paginate': True,
- 'page_url': '/links/%d/',
-}
+from . import views
-urlpatterns = patterns('',
- (r'^(?P<page>\d+)/$', list_detail.object_list, dict(photos_paged, template_name='archives/links.html')),
- (r'^$', redirect_to, {'url': '/links/1/'}),
-)
+urlpatterns = [
+ url(
+ regex=r'tag/(?P<slug>[-\w]+)/(?P<page>\d+)/$',
+ view=views.LinkTagListView.as_view(),
+ name='list-tag'
+ ),
+ url(
+ regex=r'(?P<slug>[-\d]+).txt$',
+ view=views.LinkDetailViewTXT.as_view(),
+ name="detail-txt"
+ ),
+ url(
+ regex=r'(?P<slug>[-\d]+)$',
+ view=views.LinkDetailView.as_view(),
+ name='detail'
+ ),
+ url(
+ regex=r'(?P<page>\d+)/$',
+ view=views.LinkListView.as_view(),
+ name='list'
+ ),
+ url(
+ regex=r'^tag/(?P<slug>[-\w]+)/$',
+ view=RedirectView.as_view(url="/links/tag/%(slug)s/1/", permanent=False),
+ name="live-redirect-tag"
+ ),
+ url(
+ regex=r'^$',
+ view=RedirectView.as_view(url="/links/1/", permanent=False),
+ name="live-redirect"
+ ),
+]