Пример #1
0
def archive_year(request, year):
    return YearArchiveView.as_view(
        model=Post,
        queryset=Post.objects.published().select_related(),
        date_field="date_published",
        year=year,
        context_object_name="post",
        make_object_list=YEAR_POST_LIST,
    )
Пример #2
0
from django.conf.urls import patterns, url
from django.views.generic import DetailView
from django.views.generic.dates import (DayArchiveView, MonthArchiveView,
                                        YearArchiveView)

from invoice.models import Invoice
from invoice.views import (member_invoice, edit_invoice, print_invoice,
                           print_invoice_booklet, send_invoice)


urlpatterns = patterns(
    '',
    url(r'^$',
        YearArchiveView.as_view(template_name='invoice/year.html',
                                date_field='due_date',
                                model=Invoice),
        name='invoice'),
    url(r'^month/$',
        MonthArchiveView.as_view(template_name='invoice/month.html',
                                 date_field='due_date',
                                 model=Invoice),
        name='invoice_month'),
    url(r'^day/$',
        DayArchiveView.as_view(template_name='invoice/day.html',
                               date_field='due_date',
                               model=Invoice),
        name='invoice_day'),
    url(r'^(?P<member_id>\d+)/$', member_invoice, name='member_invoice'),
    url(r'^edit/(?P<invoice_id>\d+)/$', edit_invoice, name='edit_invoice'),
    url(r'^print/(?P<invoice_id>\d+)/$', print_invoice, name='print_invoice'),
    url(r'^print/booklet/(?P<member_id>\d+)/$', print_invoice_booklet,
from django.conf.urls import patterns, include, url
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from django.views.generic.dates import ArchiveIndexView,DateDetailView, YearArchiveView, MonthArchiveView, DayArchiveView

from coltrane.models import Entry

urlpatterns = patterns('django.views.generic.dates',
    #url(r'^/{0,1}$', 'coltrane.views.entries_index'),
    url(r'^$',
        ArchiveIndexView.as_view(queryset=Entry.live.all(),
                                 date_field='pub_date'),
                                 name='coltrane_entry_archive_index'),
   
    url(r'^(?P<year>\d{4})/$',
        YearArchiveView.as_view(queryset=Entry.live.all(),
                                date_field='pub_date'),
                                name='coltrane_entry_archive_year'),

    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/{0,1}$',
        MonthArchiveView.as_view(queryset=Entry.live.all(),
                                 date_field='pub_date'),
                                 name='coltrane_entry_archive_month'),
    

    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/$',
        DayArchiveView.as_view(queryset=Entry.live.all(),
                               date_field='pub_date'),
                               name='coltrane_entry_archive_day'),

    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$',
        DateDetailView.as_view(queryset=Entry.live.all(),
Пример #4
0
from django.conf.urls import url
from django.views.generic.dates import (ArchiveIndexView, YearArchiveView,
                                        MonthArchiveView)

from .models import Picture
from .views import (GalleryListView, GalleryDetailView, PicturesListView,
                    PictureDetailView, PictureUploadView)

urlpatterns = [
    url(r'^$', GalleryListView.as_view(), name='gallery-list'),
    url(r'^gallery/(?P<pk>\d+)$', GalleryDetailView.as_view(),
        name='gallery-detail'),
    url(r'^pics$', PicturesListView.as_view(), name='pictures-list'),
    url(r'^pic/(?P<pk>\d+)$', PictureDetailView.as_view(),
        name='picture-detail'),
    url(r'^pic/new$', PictureUploadView.as_view(), name='picture-upload'),

    # Archive views for pictures
    url(r'^archive/$', ArchiveIndexView.as_view(model=Picture,
                                                date_field='date'),
        name='pictures-archive-index'),
    url(r'^archive/(?P<year>[0-9]{4})/',
        YearArchiveView.as_view(model=Picture, date_field='date'),
        name='pictures-archive-year'),
    url(r'^archive/(?P<year>[0-9]{4})/(?P<month>[0-9]+)/',
        MonthArchiveView.as_view(model=Picture, date_field='date',
                                 month_format='%m'))
]
Пример #5
0
entry_info_dict = {
    'queryset': Entry.objects.all(),
    'date_field': 'pub_date',
}
link_info_dict = {
    'queryset': Link.objects.all(),
    'date_field': 'pub_date',
}

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^search/$', search),
    url(r'^weblog/$',
        ArchiveIndexView.as_view(model=Entry, date_field="pub_date")),
    url(r'^weblog/(?P<year>\d{4})/$',
        YearArchiveView.as_view(model=Entry, date_field="pub_date")),
    url(r'^weblog/(?P<year>\d{4})/(?P<month>\w{3})/$',
        MonthArchiveView.as_view(model=Entry, date_field="pub_date")),
    url(r'^weblog/(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/$',
        DayArchiveView.as_view(model=Entry, date_field="pub_date")),
    url(
        r'^weblog/(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$',
        DateDetailView.as_view(model=Entry, date_field="pub_date")),
    url(r'^weblog/$',
        ArchiveIndexView.as_view(model=Link, date_field="pub_date")),
    url(r'^weblog/(?P<year>\d{4})/$',
        YearArchiveView.as_view(model=Link, date_field="pub_date")),
    url(r'^weblog/(?P<year>\d{4})/(?P<month>\w{3})/$',
        MonthArchiveView.as_view(model=Link, date_field="pub_date")),
    url(r'^weblog/(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/$',
        DayArchiveView.as_view(model=Link, date_field="pub_date")),
Пример #6
0
archive_index_dict.update(
    num_latest=100,
    template_object_name='latestevents',
    allow_empty=True,
)

event_detail_dict = date_dict.copy()
event_detail_dict.update(template_object_name='event')


urlpatterns = patterns('',
    (r'^$',
     'cal.views.index', {}, 'cal_index'),
    (r'^(?P<year>\d{4})/$', YearArchiveView.as_view(
        queryset=Event.all.all(),
        date_field="startDate",
        allow_future=True,
        make_object_list=True
    ), {}, "cal_archive_year"),
    (r'^(?P<year>\d{4})/(?P<month>\d{2})/$',
     'cal.views.monthly',),
    (r'^special/(?P<typ>\w+)/(?P<name>\w+)/$',
     'cal.views.display_special_events'),
    (r'^event/(?P<pk>\d+)/$', DetailView.as_view(
        queryset=Event.all.all(),
        context_object_name='event'
    ), {}, 'cal_event_detail'),
    (r'^event/(?P<object_id>\d+)/update/$',
     'cal.views.update_event', {'new': False}),
    (r'^(?P<object_id>\d+)/update/$',
     'cal.views.update_event', {'new': False}),
    (r'^event/(?P<object_id>\d+)/delete/', 'cal.views.delete_event'),
Пример #7
0
from endless_pagination.views import AjaxListView

from apps.feeds.models import Post
from apps.feeds.xml import RssFeed, AtomFeed, iTunesPodcastsFeed
from apps.feeds.views import PostsByFeedView, FeedTopArchiveView, FeedYearArchiveView, FeedMonthArchiveView, PostDetailView

urlpatterns = patterns(
    '',
    url(r'^(?P<slug>[-\w\d]+)/$',
        PostsByFeedView.as_view(),
        name='posts_by_feed'),
    url(r'^(?P<slug>[-\w\d]+)/archive/$',
        FeedTopArchiveView.as_view(),
        name='archive_top'),
    url(r'^(?P<slug>[-\w\d]+)/(?P<year>\d{4})/$',
        YearArchiveView.as_view(),
        name='year_posts'),
    url(r'^(?P<slug>[-\w\d]+)/(?P<year>\d{4})/(?P<month>\w{3})/$',
        FeedMonthArchiveView.as_view(),
        name='month_posts'),
    url(r'^(?P<feed>[-\w\d]+)/(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(?P<slug>[-\w\d]+)/$',
        PostDetailView.as_view(),
        name='post_detail'),
    url(r'^(?P<slug>[-\w\d]+)/subscribe/rss.xml$', RssFeed(), name="feed-rss"),
    url(r'^(?P<slug>[-\w\d]+)/subscribe/atom.xml$',
        AtomFeed(),
        name="atom-rss"),
    url(r'^(?P<slug>[-\w\d]+)/subscribe/podcast.xml$',
        iTunesPodcastsFeed(),
        name="podcast-rss"),
)
Пример #8
0
from django.conf.urls.defaults import patterns, url
from django.views.generic.dates import YearArchiveView, MonthArchiveView, DayArchiveView

from newsletters.views import NewsletterView
from newsletters.models import Edition

urlpatterns = patterns('',
    url(r'^(?P<id>\d+)/',
        YearArchiveView.as_view(model=Edition,
                                                   queryset=Edition.published_objects.all(),
                                                   template_name='newsletters/newsletter-list.html',
                                                   date_field='publish_on')),
                       url(r'^',
                           NewsletterView.as_view(), name="newsletter-latest")
)
Пример #9
0
                         context_object_name='latest_blog_list',
                         paginate_by=3),
        name='news_category_list'),
    url(r'^category/(?P<slug>[-\w]+)/$',
        CategoryNewsListView.as_view(),
        name='news_category_detail'),

    #url(r'^$',
    #    ArchiveIndexView.as_view(
    #        queryset            = News.objects.all(),
    #        date_field          = 'pub_date',
    #    ),
    #    name='news_archive_index'),
    url(r'^(?P<year>\d{4})/$',
        YearArchiveView.as_view(queryset=News.objects.all(),
                                date_field='pub_date',
                                make_object_list=True),
        name='news_archive_index_year'),
    url(r'^(?P<year>\d{4})/(?P<month>\d{2})/$',
        MonthArchiveView.as_view(queryset=News.objects.all(),
                                 date_field='pub_date',
                                 month_format='%m'),
        name='news_archive_index_month'),
    url(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{1,2})/$',
        MonthArchiveView.as_view(queryset=News.objects.all(),
                                 date_field='pub_date',
                                 month_format='%m'),
        name='news_archive_index_day'),
    url(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{1,2})/(?P<slug>[-\w]+)/$',
        NewsDetailView.as_view(date_field='pub_date', month_format='%m'),
        name='news_detail'),
Пример #10
0
from wolf.views import category_detail

entry_info_dict = {
'queryset': Entry.objects.all(),
'date_field': 'pub_date',
}
link_info_dict = {
'queryset': Link.objects.all(),
'date_field': 'pub_date',
}

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^search/$', search),
    url(r'^weblog/$', ArchiveIndexView.as_view(model=Entry, date_field="pub_date")),
    url(r'^weblog/(?P<year>\d{4})/$', YearArchiveView.as_view(model=Entry,date_field="pub_date")),
    url(r'^weblog/(?P<year>\d{4})/(?P<month>\w{3})/$',MonthArchiveView.as_view(model=Entry,date_field="pub_date")),
    url(r'^weblog/(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/$',DayArchiveView.as_view(model=Entry,date_field="pub_date")),
    url(r'^weblog/(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$',DateDetailView.as_view(model=Entry,date_field="pub_date")),

    url(r'^weblog/$', ArchiveIndexView.as_view(model=Link, date_field="pub_date")),
    url(r'^weblog/(?P<year>\d{4})/$', YearArchiveView.as_view(model=Link,date_field="pub_date")),
    url(r'^weblog/(?P<year>\d{4})/(?P<month>\w{3})/$',MonthArchiveView.as_view(model=Link,date_field="pub_date")),
    url(r'^weblog/(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/$',DayArchiveView.as_view(model=Link,date_field="pub_date")),
    url(r'^weblog/(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$',DateDetailView.as_view(model=Link,date_field="pub_date")),
    url(r'', include('django.contrib.flatpages.urls')),

    url(r'^categories/$',ListView.as_view(queryset=Category.objects.all())),
    url(r'^categories/(?P<slug>[-\w]+)/$',category_detail),
    url(r'^tags/$',ListView.as_view(queryset=Tag.objects.all())),
]
Пример #11
0
urlpatterns = [
    url(r'^$',
        ArchiveIndexView.as_view(date_field='pub_date',
                                 queryset=Entry.live.all()),
        name='blog_entry_archive'),
    url(r'^author/(?P<id>[\d]+)/$', author_detail, name='blog_author_detail'),
    url(r'^category/$',
        ListView.as_view(queryset=Category.objects.all()),
        name='blog_category_list'),
    url(r'^category/(?P<slug>[-\w]+)/$',
        category_detail,
        name='blog_category_detail'),
    url(r'^feed/$', EntriesFeed(), name='blog_feed'),
    url(r'^(?P<year>\d{4})/$',
        YearArchiveView.as_view(date_field='pub_date',
                                make_object_list=True,
                                queryset=Entry.live.all()),
        name='blog_entry_archive_year'),
    url(r'^(?P<year>\d{4})/(?P<month>[-\w]+)/$',
        MonthArchiveView.as_view(date_field='pub_date',
                                 queryset=Entry.live.all()),
        name='blog_entry_archive_month'),
    url(r'^(?P<year>\d{4})/(?P<month>[-\w]+)/(?P<day>\d{2})/$',
        DayArchiveView.as_view(date_field='pub_date',
                               queryset=Entry.live.all()),
        name='blog_entry_archive_day'),
    url(r'^(?P<year>\d{4})/(?P<month>[-\w]+)/(?P<day>\d{2})/(?P<slug>[-\w]+)/$',
        DateDetailView.as_view(
            date_field='pub_date',
            queryset=Entry.objects.exclude(status=Entry.HIDDEN_STATUS),
        ),
Пример #12
0
from django.conf.urls import patterns
from blog.models import BlogItem
from blog.feeds import RssBlogFeed
from community.summary import get_latest_news
from django.views.generic.dates import YearArchiveView, MonthArchiveView, DayArchiveView
from django.views.generic.dates import DateDetailView
from django.views.generic.list import ListView

info_dict = {
    'queryset' : BlogItem.objects.all(),
    'date_field' : 'pub_date',
}
#extra_dict = {
#    'slug_field' : 'slug',
#    'extra_context' : get_latest_news(),
#}

urlpatterns = patterns('',
    (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[A-Za-z0-9-_]+)/$', DateDetailView.as_view(**info_dict)),
    (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/$', DayArchiveView.as_view(**info_dict)),
    (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$', MonthArchiveView.as_view(**info_dict)),
    (r'^(?P<year>\d{4})/$', YearArchiveView.as_view(**info_dict)),
    (r'^rss/latest/$', RssBlogFeed),
)
Пример #13
0
from django.conf.urls import *
from django.views.generic.dates import ArchiveIndexView, YearArchiveView, MonthArchiveView, DayArchiveView, DateDetailView

from jraywo.models import Link
 
urlpatterns = patterns('',
    url(r'^$', ArchiveIndexView.as_view(model=Link,
                                        date_field='pub_date',
                                        allow_empty = True,
                                        paginate_by = 5), name='jraywo_link_archive_index'), 
    url(r'^(?P<year>\d{4})/$', YearArchiveView.as_view(model=Link,
                                                       date_field='pub_date',
                                                       make_object_list=True,
                                                       allow_empty = True,
                                                       paginate_by = 5), name='jraywo_link_archive_year'), 
    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/$', MonthArchiveView.as_view(model=Link,
                                                                         date_field='pub_date',
                                                                         allow_empty = True,
                                                                         paginate_by = 5),name='jraywo_link_archive_month'), 
    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/$', DayArchiveView.as_view(model=Link,
                                                                                      date_field='pub_date',
                                                                                      allow_empty = True,
                                                                                      paginate_by = 5), name='jraywo_link_archive_day'), 
    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$', DateDetailView.as_view(model=Link,
                                                                                                       date_field='pub_date'), name='jraywo_link_detail'),
)
Пример #14
0
from django.conf.urls import patterns, url
from django.views.generic.dates import ArchiveIndexView, YearArchiveView, MonthArchiveView, DayArchiveView, DateDetailView
from coltrane.models import Entry

urlpatterns = patterns('',
                       url(r'^$', ArchiveIndexView.as_view(model=Entry, date_field='pub_date',
                                                           queryset=Entry.live.all()), name='coltrane_entry_archive_index'),
                       url(r'^(?P<year>\d{4})/$', YearArchiveView.as_view(model=Entry, make_object_list=True,
                                                                          queryset=Entry.live.all(),
                                                                          date_field='pub_date'), name='coltrane_entry_archive_year'),
                       url(r'^(?P<year>\d{4})/(?P<month>\w{3})/$', MonthArchiveView.as_view(model=Entry,
                                                                                            queryset=Entry.live.all(),
                                                                                            date_field='pub_date'), name='coltrane_entry_archive_month' ),
                       url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/$',
                           DayArchiveView.as_view(model=Entry, date_field='pub_date',
                                                  queryset=Entry.live.all()), name='coltrane_entry_archive_day'),
                       url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$',
                           DateDetailView.as_view(model=Entry, date_field='pub_date',
                                                  queryset=Entry.live.all()),
                           name='coltrane_entry_details'),
                       )
Пример #15
0
from django.conf.urls.defaults import patterns, url
from django.views.generic.dates import DateDetailView, ArchiveIndexView, YearArchiveView, MonthArchiveView, DayArchiveView

from coltrane.models import Link

urlpatterns = patterns('django.views.generic.dates',
    url(r'^$',
        ArchiveIndexView.as_view(queryset=Link.objects.all(),
                                 date_field='pub_date'),
                                 name='coltrane_link_archive_index'),

    url(r'^(?P<year>\d{4})/$',
        YearArchiveView.as_view(queryset=Link.objects.all(),
                                date_field='pub_date'),
                                name='coltrane_link_archive_year'),

    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/$',
        MonthArchiveView.as_view(queryset=Link.objects.all(),
                                 date_field='pub_date'),
                                 name='coltrane_link_archive_month'),

    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/$',
        DayArchiveView.as_view(queryset=Link.objects.all(),
                               date_field='pub_date'),
                               name='coltrane_link_archive_day'),

    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$',
        DateDetailView.as_view(queryset=Link.objects.all(),
                               date_field='pub_date'),
                               name='coltrane_link_detail'),
                               
#coding=utf-8
#URLS for Coltrane app

from coltrane.models import Entry, Category
from coltrane.views import CategoryDetailView

from django.conf.urls import patterns, include, url
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from django.views.generic.dates import DateDetailView, YearArchiveView, MonthArchiveView, DayArchiveView
from django.conf import settings

entry_info_dict = {
    'queryset': Entry.objects.all(),
    'date_field': 'pub_date',
}

urlpatterns = patterns('',
    url(r'^(?P<year>\d{4})/{0,1}$', YearArchiveView.as_view(model=Entry, date_field="pub_date", make_object_list = True), name='coltrane_entry_archive_year'),
    url(r'^(?P<year>\d{4})/(?P<month>\d{2})/{0,1}$', MonthArchiveView.as_view(model=Entry, date_field="pub_date", month_format="%m"), name='coltrane_entry_archive_month'),
    url(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/{0,1}$', DayArchiveView.as_view(model=Entry, date_field="pub_date", month_format="%m"), name='coltrane_entry_archive_day'),
    url(r'(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[-\w]+)/{0,1}$', DateDetailView.as_view(model=Entry, date_field="pub_date", month_format="%m"), name='coltrane_entry_detail'),
)
urlpatterns += patterns('',
    url(r'^categories/{0,1}', ListView.as_view(model=Category), name='coltrane_category_list'),
    url(r'^categories/(?P<slug>[-\w]+)/{0,1}$', CategoryDetailView.as_view(), name="coltrane_category_detail"),
    url(r'/{0,1}$', 'coltrane.views.category_list'), 
)
Пример #17
0

urlpatterns = patterns('',
    url(r'^$',
        ArchiveIndexView.as_view(
            date_field = 'fecha_publicacion',
            paginate_by = 5,
            allow_empty = True,
            queryset = Noticia.live.all()
        ),
        name='noticia_archivo'
    ),
    url(r'^(?P<year>\d{4})/$',
        YearArchiveView.as_view(
            date_field = 'fecha_publicacion',
            paginate_by= 5,
            allow_empty= True,
            queryset= Noticia.live.all()),
        name='noticia_year'),
    url(r'^(?P<year>\d{4})/(?P<month>\d{2})/$',
        MonthArchiveView.as_view(
            date_field= 'fecha_publicacion',
            month_format = '%m',
            paginate_by= 5,
            allow_empty= True,
            queryset= Noticia.live.all()),
        name='noticia_mes'),
    url(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/$',
        DayArchiveView.as_view(
            date_field= 'fecha_publicacion',
            month_format = '%m',
Пример #18
0
from django.conf.urls import patterns, include, url
from django.views.generic.dates import YearArchiveView, MonthArchiveView 

from endless_pagination.views import AjaxListView

from apps.feeds.models import Post
from apps.feeds.xml import RssFeed, AtomFeed, iTunesPodcastsFeed
from apps.feeds.views import PostsByFeedView, FeedTopArchiveView, FeedYearArchiveView, FeedMonthArchiveView, PostDetailView
 
urlpatterns = patterns('',
  

    url(r'^(?P<slug>[-\w\d]+)/$', PostsByFeedView.as_view(), name='posts_by_feed'),
    url(r'^(?P<slug>[-\w\d]+)/archive/$', FeedTopArchiveView.as_view(), name='archive_top'),
    url(r'^(?P<slug>[-\w\d]+)/(?P<year>\d{4})/$', YearArchiveView.as_view(), name='year_posts'),
    url(r'^(?P<slug>[-\w\d]+)/(?P<year>\d{4})/(?P<month>\w{3})/$', FeedMonthArchiveView.as_view(), name='month_posts'),
    url(r'^(?P<feed>[-\w\d]+)/(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(?P<slug>[-\w\d]+)/$', PostDetailView.as_view(), name='post_detail'),


    url(r'^(?P<slug>[-\w\d]+)/subscribe/rss.xml$', RssFeed(), name="feed-rss"),
    url(r'^(?P<slug>[-\w\d]+)/subscribe/atom.xml$', AtomFeed(), name="atom-rss"),
    url(r'^(?P<slug>[-\w\d]+)/subscribe/podcast.xml$', iTunesPodcastsFeed(), name="podcast-rss"),

)
Пример #19
0
from django.conf.urls import *
from django.views.generic.dates import ArchiveIndexView, YearArchiveView, MonthArchiveView, DayArchiveView, DateDetailView
from jraywo.models import Entry

urlpatterns = patterns('',
    url(r'^$', ArchiveIndexView.as_view( queryset = Entry.live.all(),
                                         date_field = 'pub_date',
                                         allow_empty = True,
                                         paginate_by = 5,
                                        ), name='jraywo_entry_archive_index'), 
    url(r'^(?P<year>\d{4})/$', YearArchiveView.as_view(queryset = Entry.live.all(),
                                                       date_field='pub_date',
                                                       allow_empty = True,
                                                       make_object_list=True), name='jraywo_entry_archive_year'), 
    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/$', MonthArchiveView.as_view(queryset = Entry.live.all(),
                                                                         date_field = 'pub_date',
                                                                         allow_empty = True,
                                                                         paginate_by = 5,
                                                                         ), name='jraywo_entry_archive_month'), 
    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/$', DayArchiveView.as_view(queryset = Entry.live.all(),
                                                                                      date_field = 'pub_date',
                                                                                      allow_empty = True,
                                                                                       paginate_by = 5,
                                                                                      ), name='jraywo_entry_archive_day'), 
    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$', DateDetailView.as_view(queryset = Entry.live.all(),
                                                                                                       date_field = 'pub_date',
                                                                                                       ), name='jraywo_entry_detail'),
        
)
Пример #20
0
urlpatterns = patterns('',
    url(r'^$',
        ArchiveIndexView.as_view(
            date_field = 'fecha_evento',
            paginate_by = 9,
            allow_empty = True,
            queryset = Noche.live.exclude(fecha_evento__lt=date.today()).reverse(),
            allow_future = True
        ),
        name='noche_archivo'
    ),
    url(r'^(?P<year>\d{4})/$',
        YearArchiveView.as_view(
            date_field = 'fecha_evento',
            paginate_by= 9,
            allow_empty= True,
            queryset= Noche.live.all()),
        name='noche_year'),
    url(r'^(?P<year>\d{4})/(?P<month>\d{2})/$',
        MonthArchiveView.as_view(
            date_field= 'fecha_evento',
            month_format = '%m',
            paginate_by= 9,
            allow_empty= True,
            queryset= Noche.live.exclude(fecha_evento__lt=date.today()).reverse(),
            allow_future = True),
        name='noche_mes'),
    url(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/$',
        DayArchiveView.as_view(
            date_field= 'fecha_evento',
Пример #21
0
archive_index_dict = date_dict.copy()
archive_index_dict.update(
    num_latest=100,
    template_object_name='latestevents',
    allow_empty=True,
)

event_detail_dict = date_dict.copy()
event_detail_dict.update(template_object_name='event')

urlpatterns = patterns(
    '',
    (r'^$', 'cal.views.index', {}, 'cal_index'),
    (r'^(?P<year>\d{4})/$',
     YearArchiveView.as_view(queryset=Event.all.all(),
                             date_field="startDate",
                             allow_future=True,
                             make_object_list=True), {}, "cal_archive_year"),
    (
        r'^(?P<year>\d{4})/(?P<month>\d{2})/$',
        'cal.views.monthly',
    ),
    (r'^special/(?P<typ>\w+)/(?P<name>\w+)/$',
     'cal.views.display_special_events'),
    (r'^event/(?P<pk>\d+)/$',
     DetailView.as_view(queryset=Event.all.all(),
                        context_object_name='event'), {}, 'cal_event_detail'),
    (r'^event/(?P<object_id>\d+)/update/$', 'cal.views.update_event', {
        'new': False
    }),
    (r'^(?P<object_id>\d+)/update/$', 'cal.views.update_event', {
        'new': False
Пример #22
0
from django.conf.urls.defaults import patterns, url
from django.views.generic.dates import YearArchiveView, MonthArchiveView, DayArchiveView

from newsletters.views import NewsletterView
from newsletters.models import Edition

urlpatterns = patterns(
    '',
    url(
        r'^(?P<id>\d+)/',
        YearArchiveView.as_view(
            model=Edition,
            queryset=Edition.published_objects.all(),
            template_name='newsletters/newsletter-list.html',
            date_field='publish_on')),
    url(r'^', NewsletterView.as_view(), name="newsletter-latest"))
Пример #23
0
    url(r'^category/(?P<slug>[-\w]+)/$',
        CategoryNewsListView.as_view(),
        name='news_category_detail'),

    #url(r'^$',
    #    ArchiveIndexView.as_view(
    #        queryset            = News.objects.all(),
    #        date_field          = 'pub_date',
    #    ),
    #    name='news_archive_index'),

    url(r'^(?P<year>\d{4})/$',
        YearArchiveView.as_view(
            queryset            = News.objects.all(),
            date_field          = 'pub_date',
            make_object_list    = True
        ),
        name='news_archive_index_year'),


    url(r'^(?P<year>\d{4})/(?P<month>\d{2})/$',
        MonthArchiveView.as_view(
            queryset            = News.objects.all(),
            date_field          = 'pub_date',
            month_format        = '%m'
        ),
        name='news_archive_index_month'),

    url(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{1,2})/$',
        MonthArchiveView.as_view(
Пример #24
0
from django.conf.urls import patterns, include, url
from django.views.generic.dates import (ArchiveIndexView, YearArchiveView,
    MonthArchiveView, DateDetailView)
from aspc.blog.models import Post
from aspc.blog.views import PostDetail, PostArchive, PostMonthArchive

detail_kwargs = {
    'model': Post,
    'date_field': 'posted',
    'context_object_name': 'post',
}

post_kwargs = detail_kwargs.copy()
post_kwargs.update({
    'allow_empty': True,
    'context_object_name': 'posts',
})

urlpatterns = patterns('',
    url(r'^$', PostArchive.as_view(**post_kwargs), name="post_index"),
    url(r'^(?P<year>\d{4})/$', YearArchiveView.as_view(**post_kwargs), name="post_year"),
    url(r'^(?P<year>\d{4})/(?P<month>[^/]+)/$', PostMonthArchive.as_view(**post_kwargs), name="post_month"),
    url(r'^(?P<year>\d{4})/(?P<month>[^/]+)/(?P<slug>[A-Za-z0-9_-]+)/$', PostDetail.as_view(**detail_kwargs), name="post_detail"),
)
Пример #25
0
from yadates.csvdates.models import Article
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'yadates.views.home', name='home'),
    # url(r'^yadates/', include('yadates.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
    
    url(r'^articles/year/(?P<year>\d+)/$',YearArchiveView.as_view(
        model=Article,
        date_field='pub_date',
        allow_future=True,
    ),name="yearly"),
    """    
    url(r'^articles/year/(?P<year>\d+)/$',YearArchiveView.as_view(
        model=Article,
        date_field='pub_date',
    ),name="yearly"),

    """    
)
Пример #26
0
    'model': Post,
    'date_field': 'pub_date',
    'paginate_by': 10,
    'template_name': 'blog/display_object_list.html',
}

urlpatterns = patterns(
    '',

    # All post listing
    url(r'^$', 'blog.views.post_archive_index', name='post_archive_index'),

    # Yearly Archieve
    url(r'^(?P<year>\d{4})/$',
        YearArchiveView.as_view(make_object_list=True,
                                allow_future=True,
                                **post_info_dict),
        name='post_archive_year'),

    # Monthly Archieve
    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/$',
        MonthArchiveView.as_view(**post_info_dict),
        name='post_archive_month'),

    # Daily Archieve
    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/$',
        DayArchiveView.as_view(**post_info_dict),
        name='post_archive_day'),

    # Post by Tag
    url(r'^tag/(?P<tag>[-\w]+)/$',
Пример #27
0
from django.conf.urls.defaults import patterns, url
from blog.models import Post
from blog.views import ArchiveCategoryView
from django.views.generic.dates import ArchiveIndexView, YearArchiveView, MonthArchiveView, DateDetailView
from blog.feeds import LatestEntriesFeed

info = {
    'model': Post,
    'date_field': 'date',
}

urlpatterns = patterns('', 
    url(r'^$', ArchiveIndexView.as_view(**info), name='blog-index'),
    url(r'^feed/$', LatestEntriesFeed(), name='blog-feed'),
    url(r'^(?P<year>\d{4})/$', YearArchiveView.as_view(**info), name='blog-archive-year'),
    url(r'^(?P<year>\d{4})/(?P<month>[A-z]{3})/$', MonthArchiveView.as_view(**info), name='blog-archive-month'),
    url(r'^(?P<category>[\w-]+)/$', ArchiveCategoryView.as_view(**info), name='blog-archive-category'),
    url(r'^(?P<year>\d{4})/(?P<month>[A-z]{3})/(?P<day>\d+)/(?P<slug>.+)/$',  DateDetailView.as_view(**info), name='blog-post'),
)
Пример #28
0
from blog.models import Post

post_info_dict = {
	'model': Post,
	'date_field': 'pub_date',
	'paginate_by': 10,
	'template_name': 'blog/display_object_list.html',
}

urlpatterns = patterns('',

    # All post listing
    url(r'^$', 'blog.views.post_archive_index', name='blog'),

    # Yearly Archieve
    url(r'^(?P<year>\d{4})/$', YearArchiveView.as_view(make_object_list = True, allow_future = True, **post_info_dict), name='post_archive_year'),
    
    # Monthly Archieve
    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/$', MonthArchiveView.as_view(**post_info_dict), name='post_archive_month'),
    
    # Daily Archieve
    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/$', DayArchiveView.as_view(**post_info_dict), name='post_archive_day'),

    # Post by Tag
    url(r'^tag/(?P<tag>[-\w]+)/$', 'blog.views.get_blog_by_tag', name='blog_by_tag'),
   
    # Post Entry Detail View
    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$', 'blog.views.detail_view', name="get_post_detail"),

    # Add Comment
    url(r'^add_comment/(?P<post_id>\d+)', 'blog.views.add_comment', name='add_comment'),
Пример #29
0
from django.conf.urls.defaults import patterns, include, url
from django.views.generic import DetailView, ListView
from django.views.generic.dates import YearArchiveView, MonthArchiveView
from longdeadsignal.apps.news.models import Post
from longdeadsignal.apps.news.feeds import PostFeed
from longdeadsignal.apps.news import settings as app_settings

urlpatterns = patterns('',
    url(r'^(?P<year>(19|20)\d\d)/$', YearArchiveView.as_view(
        model=Post,
        date_field='pub_date',
        make_object_list=True
    ), name='post_archive_year'),
    
    url(r'^(?P<year>(19|20)\d\d)/(?P<month>[A-Z|a-z][a-z]{2})/$', MonthArchiveView.as_view(
        model=Post,
        date_field='pub_date',
    ), name='post_archive_month'),
    
    url(r'^feed/$', PostFeed(), name='feed'),
    
    url(r'^page/(?P<page>[0-9]+)/$', ListView.as_view(model=Post, paginate_by=app_settings.PAGINATE_BY), name='post_list'),
    url(r'^(?P<slug>[^/]+)/$', DetailView.as_view(model=Post), name='post_detail'),
    url(r'^$', ListView.as_view(model=Post, paginate_by=app_settings.PAGINATE_BY), name='post_list'),
)
Пример #30
0
    url(r'^matches$', MatchListView.as_view(), name='match_list'),
    url(r'^matches/(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})$', DayArchiveView.as_view(
        model=MatchStat,
        month_format="%m",
        date_field='match_date',
        template_name='match_day_list.html',
    ), name='match_day_list'),
    url(r'^matches/(?P<year>\d{4})-(?P<month>\d{2})$', MonthArchiveView.as_view(
        model=MatchStat,
        month_format="%m",
        date_field='match_date',
        template_name='match_day_list.html',
    ), name='match_month_list'),
    url(r'^matches/(?P<year>\d{4})$', YearArchiveView.as_view(
        model=MatchStat,
        date_field='season',
        template_name='match_day_list.html',
        make_object_list=True,
    ), name='match_year_list'),
    url(r'^match/(?P<pk>\d+)/$', MatchDetailView.as_view(), name='match_detail'),

    # Search
    url(r'^search/', include('haystack.urls')),

    # League
    url(r'^leagues$', LeagueIndexView.as_view(), name='league_index'),
    url(r'^league/(?P<league>E[0123C])$', LeagueListView.as_view(), name='league_list'),

    # Admin
    url(r'^admin/', include(admin.site.urls)),
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
Пример #31
0
from django.conf.urls import patterns, url
from django.views.generic.dates import ArchiveIndexView, YearArchiveView, MonthArchiveView, DayArchiveView, DateDetailView
from coltrane.models import Link

urlpatterns = patterns('',
                       url(r'^$', ArchiveIndexView.as_view(model=Link, date_field='pub_date'), name='coltrane_link_archive_index'),
                       url(r'^(?P<year>\d{4})/$', YearArchiveView.as_view(model=Link, make_object_list=True,
                                                                                date_field='pub_date')),
                       url(r'^(?P<year>\d{4})/(?P<month>\w{3})/$', MonthArchiveView.as_view(model=Link,
                                                                                                  date_field='pub_date')),
                       url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/$',
                           DayArchiveView.as_view(model=Link, date_field='pub_date')),
                       url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$',
                           DateDetailView.as_view(model=Link, date_field='pub_date'), name='coltrane_link_details'),
                       )
Пример #32
0
from django.urls import path
from . import views
from users import views as user_views
from django.contrib.auth import views as auth_views
from django.conf import settings
from django.conf.urls.static import static
from .views import PostListView, PostDetailView, PostCreateView, PostUpdateView, PostDeleteView,about, BlogAPI
from django.views.generic.dates import ArchiveIndexView, YearArchiveView
from .models import Post


urlpatterns = [
        path('',views.index,name = 'index'),
        path('business/',PostListView.as_view(), name = 'business'),
        path('register/',user_views.register, name = 'register'),
        path('login/',auth_views.LoginView.as_view(template_name='users/login.html'),name='login'),
        path('logout/',auth_views.LogoutView.as_view(template_name='users/logout.html'),name='logout'),
        path('profile/',user_views.profile,name='profile'),
        path('post/<int:pk>/', PostDetailView.as_view(), name = 'post-detail'),
        path('post/new/',PostCreateView.as_view(),name='post-create'),
        path('post/<int:pk>/update/',PostUpdateView.as_view(),name='post-update'),
        path('post/<int:pk>/delete/',PostDeleteView.as_view(),name='post-delete'),
        path('post/archive/',ArchiveIndexView.as_view(model = Post, date_field = "date_posted"), name = 'post_archive'),
        path('post/yeararchive/<int:year>/',YearArchiveView.as_view(queryset = Post.objects.all(), date_field = "date_posted",
              make_object_list = True, allow_future = True),name='post-year'),
        path('about/',about,name='about'),
	path('blogapi/',BlogAPI.as_view(), name = 'BlogAPI')
]
if settings.DEBUG:
    urlpatterns += static('media/',document_root=settings.MEDIA_ROOT)
Пример #33
0
from yadates.csvdates.models import Article
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns(
    '',
    # Examples:
    # url(r'^$', 'yadates.views.home', name='home'),
    # url(r'^yadates/', include('yadates.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
    url(r'^articles/year/(?P<year>\d+)/$',
        YearArchiveView.as_view(
            model=Article,
            date_field='pub_date',
            allow_future=True,
        ),
        name="yearly"),
    """    
    url(r'^articles/year/(?P<year>\d+)/$',YearArchiveView.as_view(
        model=Article,
        date_field='pub_date',
    ),name="yearly"),

    """)
Пример #34
0
from django.views.generic.dates import (ArchiveIndexView, YearArchiveView,
                                        MonthArchiveView, DateDetailView)
from aspc.blog.models import Post
from aspc.blog.views import PostDetail, PostArchive, PostMonthArchive

detail_kwargs = {
    'model': Post,
    'date_field': 'posted',
    'context_object_name': 'post',
}

post_kwargs = detail_kwargs.copy()
post_kwargs.update({
    'allow_empty': True,
    'context_object_name': 'posts',
})

urlpatterns = patterns(
    '',
    url(r'^$', PostArchive.as_view(**post_kwargs), name="post_index"),
    url(r'^(?P<year>\d{4})/$',
        YearArchiveView.as_view(**post_kwargs),
        name="post_year"),
    url(r'^(?P<year>\d{4})/(?P<month>[^/]+)/$',
        PostMonthArchive.as_view(**post_kwargs),
        name="post_month"),
    url(r'^(?P<year>\d{4})/(?P<month>[^/]+)/(?P<slug>[A-Za-z0-9_-]+)/$',
        PostDetail.as_view(**detail_kwargs),
        name="post_detail"),
)
Пример #35
0
from django.conf.urls.defaults import *
from django.views.generic.dates import ArchiveIndexView, YearArchiveView, MonthArchiveView, DayArchiveView, DateDetailView
from coltrane.models import Link

link_info_dict = {
    'model': Link,
    'queryset': Link.objects.all(),
    'date_field': 'pub_date',
}

# Views for the Link Model
urlpatterns = patterns('',
    url(r'^$', ArchiveIndexView.as_view(**link_info_dict), name='coltrane_link_archieve_index'),
    url(r'^(?P<year>\d{4})/$', YearArchiveView.as_view(make_object_list = True, allow_future = True, **link_info_dict), name='coltrane_link_archieve_year'),
    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/$', MonthArchiveView.as_view(**link_info_dict), name='coltrane_link_archive_month'),
    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/$', DayArchiveView.as_view(**link_info_dict), name='coltrane_link_archive_day'),
    url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$', DateDetailView.as_view(**link_info_dict), name='coltrane_link_detail'),

)
Пример #36
0
    'paginate_by': 10,
}
entry_info_month = dict(entry_info, month_format='%m')

entry_info_year = entry_info.copy()
del entry_info_year['paginate_by']

category_info = {
    'queryset': Category.objects.all(),
}


urlpatterns = patterns('',
    url(r'^$', ArchiveIndexView.as_view(**entry_info), name='blog_entry_index'),
    url(r'^(?P<year>\d{4})/$',
        YearArchiveView.as_view(**entry_info_year),
        name='blog_entry_archive_year'),
    url(r'^(?P<year>\d{4})/(?P<month>\w{1,2})/$',
        MonthArchiveView.as_view(**entry_info_month),
        name = 'blog_entry_archive_month'),
    url(r'^(?P<year>\d{4})/(?P<month>\w{1,2})/(?P<day>\w{1,2})/$',
        DayArchiveView.as_view(**entry_info_month),
        name='blog_entry_archive_day'),

    url(r'^(?P<year>\d{4})/(?P<month>\w{1,2})/(?P<day>\w{1,2})/(?P<slug>[-\w]+)/$',
        EnhancedDateDetailView.as_view(),
        name='blog_entry_detail'),

    url(r'^category/(?P<slug>[-\w]+)/$',
        DetailView.as_view(**category_info),
        name='blog_category_detail'),
Пример #37
0
     name='category_list'),
 url(r'^category/(?P<slug>[-\w]+)/$',
     DetailView.as_view(
         model=Category,
         context_object_name='category',
     ),
     name='category_detail'),
 url(r'^archive/$',
     ArchiveIndexView.as_view(
         queryset=Blog.objects.all(),
         date_field='pub_date',
     ),
     name='blog_archive_index'),
 url(r'^archive/(?P<year>\d{4})/$',
     YearArchiveView.as_view(
         queryset=Blog.objects.all(),
         date_field='pub_date',
     ),
     name='blog_archive_index_year'),
 url(r'^archive/(?P<year>\d{4})/(?P<month>\d{2})/$',
     MonthArchiveView.as_view(queryset=Blog.objects.all(),
                              date_field='pub_date',
                              month_format='%m'),
     name='blog_archive_index_month'),
 url(r'^archive/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{1,2})/$',
     MonthArchiveView.as_view(queryset=Blog.objects.all(),
                              date_field='pub_date',
                              month_format='%m'),
     name='blog_archive_index_day'),
 url(r'^archive/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{1,2})/(?P<slug>[-\w]+)/$',
     DateDetailView.as_view(model=Blog,
                            context_object_name='blog',
Пример #38
0
from django.conf.urls.defaults import *
from django.views.generic.dates import YearArchiveView, MonthArchiveView, DayArchiveView, DateDetailView

from blog.models import Entry

entry_info_dict = {'queryset':Entry.live.all(), 'date_field': 'pub_date', }

urlpatterns = patterns('',
# Pagination for the equivalent of archive_index generic view.
# The url is of the form http://host/page/4/
# In urls.py for example, ('^blog/page/(?P<page>\d)/$', get_archive_index),
	url(r'^$', 'blog.views.get_archive_index_first', ),
	url(r'^page/(?P<page>\d)/$', 'blog.views.get_archive_index', ),
	#(r'^$', 'django.views.generic.date_based.archive_index', entry_info_dict,  'blog_entry_archive_index'),
	#(r'^(?P<year>\d{4})/$', YearArchiveView.as_view(), entry_info_dict, 'blog_entry_archive_year'),
	url(r'^(?P<year>\d{4})/$', YearArchiveView.as_view(**entry_info_dict), name= 'blog_entry_archive_year'),
	url(r'^(?P<year>\d{4})/(?P<month>\w{3})/$', MonthArchiveView.as_view(**entry_info_dict), name= 'blog_entry_archive_month'),
	url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/$', DayArchiveView.as_view(**entry_info_dict), name= 'blog_entry_archive_day'),
	url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$', DateDetailView.as_view(**entry_info_dict), name= 'blog_entry_detail'),
)
Пример #39
0
from django.conf.urls.defaults import patterns, url
from django.views.generic.dates import ArchiveIndexView, YearArchiveView, MonthArchiveView, DayArchiveView, DateDetailView

from jarrett.models import Resumen

urlpatterns = patterns(
    '',
    url(r'^$',
        ArchiveIndexView.as_view(date_field='fecha_publicacion',
                                 paginate_by=15,
                                 allow_empty=True,
                                 queryset=Resumen.live.all()),
        name='resumen_archivo'),
    url(r'^(?P<year>\d{4})/$',
        YearArchiveView.as_view(date_field='fecha_publicacion',
                                paginate_by=15,
                                allow_empty=True,
                                queryset=Resumen.live.all()),
        name='resumen_year'),
    url(r'^(?P<year>\d{4})/(?P<month>\d{2})/$',
        MonthArchiveView.as_view(date_field='fecha_publicacion',
                                 month_format='%m',
                                 paginate_by=15,
                                 allow_empty=True,
                                 queryset=Resumen.live.all()),
        name='resumen_mes'),
    url(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/$',
        DayArchiveView.as_view(date_field='fecha_publicacion',
                               month_format='%m',
                               paginate_by=15,
                               allow_empty=True,
                               queryset=Resumen.live.all()),
Пример #40
0
from django_blog.models import Entry


urlpatterns = patterns('',
    url(r'^$',
        ArchiveIndexView.as_view(
            date_field='pub_date',
            queryset=Entry.live.all()
        ),
        name='blog_entry_archive'
    ),

    url(r'^(?P<year>\d{4})/$',
        YearArchiveView.as_view(
            date_field='pub_date',
            make_object_list=True,
            queryset=Entry.live.all()
        ),
        name='blog_entry_archive_year'
    ),

    url(r'^(?P<year>\d{4})/(?P<month>[-\w]+)/$',
        MonthArchiveView.as_view(
            date_field='pub_date',
            queryset=Entry.live.all()
        ),
        name='blog_entry_archive_month'
    ),

    url(r'^(?P<year>\d{4})/(?P<month>[-\w]+)/(?P<day>\d{2})/$',
        DayArchiveView.as_view(
Пример #41
0
     DetailView.as_view(
         model               = Category,
         context_object_name = 'category',
     ),
     name='category_detail'),
     
 url(r'^archive/$',                     
     ArchiveIndexView.as_view(
         queryset            = Blog.objects.all(),
         date_field          = 'pub_date',
     ),
     name='blog_archive_index'),
     
 url(r'^archive/(?P<year>\d{4})/$',
     YearArchiveView.as_view(
         queryset            = Blog.objects.all(),
         date_field          = 'pub_date',
     ),
     name='blog_archive_index_year'),
 
 
 url(r'^archive/(?P<year>\d{4})/(?P<month>\d{2})/$',
     MonthArchiveView.as_view(
         queryset            = Blog.objects.all(),
         date_field          = 'pub_date',
         month_format        = '%m'
     ),
     name='blog_archive_index_month'),
 
 url(r'^archive/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{1,2})/$',
     MonthArchiveView.as_view(
         queryset            = Blog.objects.all(),
Пример #42
0
                                        MonthArchiveView)

from .models import Picture
from .views import (GalleryListView, GalleryDetailView, PicturesListView,
                    PictureDetailView, PictureUploadView)

urlpatterns = [
    url(r'^$', GalleryListView.as_view(), name='gallery-list'),
    url(r'^gallery/(?P<pk>\d+)$',
        GalleryDetailView.as_view(),
        name='gallery-detail'),
    url(r'^pics$', PicturesListView.as_view(), name='pictures-list'),
    url(r'^pic/(?P<pk>\d+)$',
        PictureDetailView.as_view(),
        name='picture-detail'),
    url(r'^pic/new$', PictureUploadView.as_view(), name='picture-upload'),

    # Archive views for pictures
    url(r'^archive/$',
        ArchiveIndexView.as_view(model=Picture, date_field='date'),
        name='pictures-archive-index'),
    url(r'^archive/(?P<year>[0-9]{4})/',
        YearArchiveView.as_view(model=Picture, date_field='date'),
        name='pictures-archive-year'),
    url(
        r'^archive/(?P<year>[0-9]{4})/(?P<month>[0-9]+)/',
        MonthArchiveView.as_view(model=Picture,
                                 date_field='date',
                                 month_format='%m'))
]