Ejemplo n.º 1
0
        name='blog-quote-detail-review'),

    # allowing access to an upcoming quote
    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{1,2})/(?P<slug>[-\w]+)/upcoming/$',
        login_required(
            generic.DateDetailView.as_view(
                queryset=Quote.objects.upcoming(),
                date_field="pub_date", month_format="%b", 
                template_name="blog/quote_detail.html", allow_future=True),
            redirect_field_name=""),
        name='blog-quote-detail-upcoming'),

    url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/$',
        PostDayArchiveView.as_view(model=Quote, paginate_by=page_size),
        name='blog-quote-archive-day'),

    url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/$',
        PostMonthArchiveView.as_view(model=Quote, paginate_by=page_size),
        name='blog-quote-archive-month'),

    url(r'^(?P<year>\d{4})/$',
        PostYearArchiveView.as_view(model=Quote, paginate_by=large_page_size),
        name='blog-quote-archive-year'),

    url(r'^$', 
        PostListView.as_view(
            model=Quote, paginate_by=page_size,
            template_name="dress_blog/quote_list.html"),
        name='blog-quote-list'),
)
Ejemplo n.º 2
0
    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{1,2})/(?P<slug>[-\w]+)/upcoming/$',
        login_required(
            generic.DateDetailView.as_view(
                queryset=Quote.objects.upcoming(),
                date_field="pub_date", month_format="%b", 
                template_name="blog/quote_detail.html", allow_future=True),
            redirect_field_name=""),
        name='blog-quote-detail-upcoming'),

    url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/$',
        PostDayArchiveView.as_view(
            model=Quote, paginate_by=settings.DRESS_BLOG_PAGINATE_BY),
        name='blog-quote-archive-day'),

    url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/$',
        PostMonthArchiveView.as_view(
            model=Quote, paginate_by=settings.DRESS_BLOG_PAGINATE_BY),
        name='blog-quote-archive-month'),

    url(r'^(?P<year>\d{4})/$',
        PostYearArchiveView.as_view(
            model=Quote, paginate_by=2*settings.DRESS_BLOG_PAGINATE_BY),
        name='blog-quote-archive-year'),

    url(r'^$', 
        PostListView.as_view(
            model=Quote, paginate_by=settings.DRESS_BLOG_PAGINATE_BY,
            template_name="dress_blog/quote_list.html"),
        name='blog-quote-list'),
)