#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
from django.views.decorators.cache import cache_page

from .views import PostDetail, PostList, AlbumList, AlbumDetail, TagList
from .views import Search
from .views.feed import ArticleFeed


urlpatterns = patterns(
    '',
    url(r'^$', cache_page(60 * 2)(PostList.as_view()), name='home'),
    url(r'^(RSS|FEED)$', cache_page(60 * 2)(ArticleFeed()), name='feed'),
    url(r'^search/', Search(), name='search'),

    # ALBUM
    url(r'^album/(?P<channel__long_slug>[\w\b//-]+)/$',
        cache_page(60 * 2)(AlbumList.as_view()), name='album_channel'),
    url(r'^album/(?P<channel__long_slug>[\w//-]+)/(?P<slug>[\w-]+)$',
        cache_page(60 * 15)(AlbumDetail.as_view()), name='album_open'),

    # TAGs
    url(r'^tag/(?P<tag>[\w//-]+)$',
        cache_page(60 * 2)(TagList.as_view()), name='tag_open'),

    # POST
    url(r'^(?P<channel__long_slug>[\w//-]+)/(?P<slug>[\w-]+)$',
        cache_page(60 * 15)(PostDetail.as_view()), name='open'),
    url(r'^(?P<channel__long_slug>[\w\b//-]+)/$',
        cache_page(60 * 2)(PostList.as_view()), name='channel'),
)

@@ -270,16 +270,29 @@
 icleFeed
+, ChannelFeed
 %0A%0A%0Aurlpa
@@ -403,16 +403,16 @@
 r'%5E(
-RSS%7CFEED
+rss%7Cfeed
 )$',
@@ -538,33 +538,24 @@
 '%5Ealbum/(?P%3C
-channel__
 long_slug%3E%5B%5C
@@ -556,32 +556,42 @@
 lug%3E%5B%5Cw%5Cb//-%5D+)/
+(rss%7Cfeed)
 $',%0A        cach
@@ -609,29 +609,44 @@
  2)(
-AlbumList.as_view()),
+ChannelFeed(model='Album')),%0A       
  nam
@@ -654,23 +654,20 @@
 ='album_
-channel
+feed
 '),%0A    
@@ -808,132 +808,388 @@
 '),%0A
-%0A    # TAGs%0A    url(r'%5Etag/(?P%3Ctag%3E%5B%5Cw//-%5D+)$',%0A        cache_page(60 * 2)(TagList.as_view()), name='tag_open'),%0A%0A    # POST
+    url(r'%5Ealbum/(?P%3Cchannel__long_slug%3E%5B%5Cw%5Cb//-%5D+)/$',%0A        cache_page(60 * 2)(AlbumList.as_view()), name='album_channel'),%0A%0A    # TAGs%0A    url(r'%5Etag/(?P%3Ctag%3E%5B%5Cw//-%5D+)$',%0A        cache_page(60 * 2)(TagList.as_view()), name='tag_open'),%0A%0A    # POST%0A    url(r'%5E(?P%3Clong_slug%3E%5B%5Cw%5Cb//-%5D+)/(rss%7Cfeed)$',%0A        cache_page(60 * 2)(ChannelFeed(model='Post')), name='channel_feed'),
 %0A   

Add feed url on all channel