# Path: blog/views.py
# class PostArchiveMonth(
#         AllowFuturePermissionMixin,
#         MonthArchiveView):
#     model = Post
#     date_field = 'pub_date'
#     month_format = '%m'
# 
# class PostArchiveYear(
#         AllowFuturePermissionMixin,
#         YearArchiveView):
#     model = Post
#     date_field = 'pub_date'
#     make_object_list = True
# 
# class PostCreate(PostFormValidMixin, CreateView):
#     form_class = PostForm
#     model = Post
# 
# class PostDelete(DateObjectMixin, DeleteView):
#     date_field = 'pub_date'
#     model = Post
#     success_url = reverse_lazy('blog_post_list')
# 
# class PostDetail(DateObjectMixin, DetailView):
#     date_field = 'pub_date'
#     queryset = (
#         Post.objects
#         .select_related('author__profile')
#         .prefetch_related('startups')
#         .prefetch_related('tags')
#     )
# 
# class PostList(
#         AllowFuturePermissionMixin,
#         ArchiveIndexView):
#     allow_empty = True
#     context_object_name = 'post_list'
#     date_field = 'pub_date'
#     make_object_list = True
#     model = Post
#     paginate_by = 5
#     template_name = 'blog/post_list.html'
# 
# class PostUpdate(
#         PostFormValidMixin,
#         DateObjectMixin,
#         UpdateView):
#     date_field = 'pub_date'
#     form_class = PostForm
#     model = Post


from django.conf.urls import url
from .views import (
    PostArchiveMonth, PostArchiveYear, PostCreate,
    PostDelete, PostDetail, PostList, PostUpdate)


urlpatterns = [
    url(r'^$',
        PostList.as_view(),
        name='blog_post_list'),
    url(r'^create/$',
        PostCreate.as_view(),
        name='blog_post_create'),
    url(r'^(?P<year>\d{4})/$',
        PostArchiveYear.as_view(),
        name='blog_post_archive_year'),
    url(r'^(?P<year>\d{4})/'
        r'(?P<month>\d{1,2})/$',

# Path: blog/views.py
# class PostArchiveMonth(
#         AllowFuturePermissionMixin,
#         MonthArchiveView):
#     model = Post
#     date_field = 'pub_date'
#     month_format = '%m'
# 
# class PostArchiveYear(
#         AllowFuturePermissionMixin,
#         YearArchiveView):
#     model = Post
#     date_field = 'pub_date'
#     make_object_list = True
# 
# class PostCreate(PostFormValidMixin, CreateView):
#     form_class = PostForm
#     model = Post
# 
# class PostDelete(DateObjectMixin, DeleteView):
#     date_field = 'pub_date'
#     model = Post
#     success_url = reverse_lazy('blog_post_list')
# 
# class PostDetail(DateObjectMixin, DetailView):
#     date_field = 'pub_date'
#     queryset = (
#         Post.objects
#         .select_related('author__profile')
#         .prefetch_related('startups')
#         .prefetch_related('tags')
#     )
# 
# class PostList(
#         AllowFuturePermissionMixin,
#         ArchiveIndexView):
#     allow_empty = True
#     context_object_name = 'post_list'
#     date_field = 'pub_date'
#     make_object_list = True
#     model = Post
#     paginate_by = 5
#     template_name = 'blog/post_list.html'
# 
# class PostUpdate(
#         PostFormValidMixin,
#         DateObjectMixin,
#         UpdateView):
#     date_field = 'pub_date'
#     form_class = PostForm
#     model = Post


# Path: blog/urls.py
from django.conf.urls import url
from .views import (
    PostArchiveMonth, PostArchiveYear, PostCreate,
    PostDelete, PostDetail, PostList, PostUpdate)



urlpatterns = [
    url(r'^$',
        PostList.as_view(),
        name='blog_post_list'),
    url(r'^create/$',
        PostCreate.as_view(),
        name='blog_post_create'),
    url(r'^(?P<year>\d{4})/$',
        PostArchiveYear.as_view(),
        name='blog_post_archive_year'),
    url(r'^(?P<year>\d{4})/'
        r'(?P<month>\d{1,2})/$',

        PostArchiveMonth.as_view(),