# Path: jellyblog/views.py
# def init_category():
# def home(request):
# def index(request):
# def index_with_page(request, page):
# def category_detail(request, category_id):
# def category_with_page(request, category_id, page):
# def search_documents(request):
# def detail(request, document_id):
# 
# Path: jellyblog/feeds.py
# class LatestFeed(Feed):
#     title = "젤리의 망상 최근 Feeds"
#     link = "/blognews/"
#     description = "젤리의 망상의 피드입니다."
# 
#     def items(self):
#         return Document.objects.filter(public_doc=True).order_by('-time')[:5]
# 
#     def item_title(self, item):
#         return item.title
# 
#     def item_description(self, item):
#         return item.content
# 
#     def item_link(self, item):
#         return reverse('detail', args=[item.pk])
# 
# class AllPublickFeed(Feed):
#     title = "젤리의 망상 Feeds"
#     link = "/blognews/"
#     description = "젤리의 망상 Feeds"
# 
#     def items(self):
#         return Document.objects.filter(public_doc=True).order_by('-time')
# 
#     def item_title(self, item):
#         return item.title
# 
#     def item_description(self, item):
#         return item.content
# 
#     def item_link(self, item):
#         return reverse('detail', args=[item.pk])
# 
# Path: jellyblog/sitemaps.py
# class BlogSitemap(Sitemap):
#     changefreq = "hourly"
#     priority = 1.0
# 
#     def items(self):
#         return Document.objects.filter(public_doc=True)
# 
#     def lastmod(self, obj):
#         return obj.update_time
# 
# Path: jellyblog/serializer.py
# class NoteSerializer(serializers.HyperlinkedModelSerializer):
#     class Meta:
# class NoteViewSet(viewsets.ReadOnlyModelViewSet):


from django.conf.urls import url, include
from django.conf import settings
from django.http import HttpResponseRedirect
from django.contrib.sitemaps.views import sitemap
from jellyblog import views
from .feeds import LatestFeed, AllPublickFeed
from .sitemaps import BlogSitemap
from .serializer import router



sitemaps = {
    'blog': BlogSitemap,
}


urlpatterns = [
    # url 오른쪽의 주석은 각각 예시를 의미
    url(r'^$', views.home, name='home'),
    # blog의 첫 페이지를 보여준다.
    url(r'^index/$', views.index, name='blog_index'),
    # 검색 결과를 보여준다.
    url(r'^search/$', views.search_documents, name='search_documents'),
    # /page/(page_number)
    url(r'^page/(?P<page>[0-9]+)/?$',
        views.index_with_page, name='index_with_page'),

    # /(document_id)
    url(r'^(?P<document_id>[0-9]+)/?$', views.detail, name='detail'),

    # /category/(category_id)
    url(r'^category/(?P<category_id>[0-9]+)/?$',

# Path: jellyblog/views.py
# def init_category():
# def home(request):
# def index(request):
# def index_with_page(request, page):
# def category_detail(request, category_id):
# def category_with_page(request, category_id, page):
# def search_documents(request):
# def detail(request, document_id):
# 
# Path: jellyblog/feeds.py
# class LatestFeed(Feed):
#     title = "젤리의 망상 최근 Feeds"
#     link = "/blognews/"
#     description = "젤리의 망상의 피드입니다."
# 
#     def items(self):
#         return Document.objects.filter(public_doc=True).order_by('-time')[:5]
# 
#     def item_title(self, item):
#         return item.title
# 
#     def item_description(self, item):
#         return item.content
# 
#     def item_link(self, item):
#         return reverse('detail', args=[item.pk])
# 
# class AllPublickFeed(Feed):
#     title = "젤리의 망상 Feeds"
#     link = "/blognews/"
#     description = "젤리의 망상 Feeds"
# 
#     def items(self):
#         return Document.objects.filter(public_doc=True).order_by('-time')
# 
#     def item_title(self, item):
#         return item.title
# 
#     def item_description(self, item):
#         return item.content
# 
#     def item_link(self, item):
#         return reverse('detail', args=[item.pk])
# 
# Path: jellyblog/sitemaps.py
# class BlogSitemap(Sitemap):
#     changefreq = "hourly"
#     priority = 1.0
# 
#     def items(self):
#         return Document.objects.filter(public_doc=True)
# 
#     def lastmod(self, obj):
#         return obj.update_time
# 
# Path: jellyblog/serializer.py
# class NoteSerializer(serializers.HyperlinkedModelSerializer):
#     class Meta:
# class NoteViewSet(viewsets.ReadOnlyModelViewSet):


# Path: jellyblog/urls.py
from django.conf.urls import url, include
from django.conf import settings
from django.http import HttpResponseRedirect
from django.contrib.sitemaps.views import sitemap
from jellyblog import views
from .feeds import LatestFeed, AllPublickFeed
from .sitemaps import BlogSitemap
from .serializer import router




sitemaps = {
    'blog': BlogSitemap,
}


urlpatterns = [
    # url 오른쪽의 주석은 각각 예시를 의미
    url(r'^$', views.home, name='home'),
    # blog의 첫 페이지를 보여준다.
    url(r'^index/$', views.index, name='blog_index'),
    # 검색 결과를 보여준다.
    url(r'^search/$', views.search_documents, name='search_documents'),
    # /page/(page_number)
    url(r'^page/(?P<page>[0-9]+)/?$',
        views.index_with_page, name='index_with_page'),

    # /(document_id)
    url(r'^(?P<document_id>[0-9]+)/?$', views.detail, name='detail'),

    # /category/(category_id)
    url(r'^category/(?P<category_id>[0-9]+)/?$',

        views.category_detail, name='category_detail'),