def archive_month(request, year, month): return MonthArchiveView.as_view( model=Post, queryset=Post.objects.published().select_related(), date_field="date_published", month=datetime.date(year, month, 1), context_object_name="post", )
def process(self, request, kwargs, context): month = kwargs.get("month") year = kwargs.get("year") if (month == "any") or (year == "any"): return print context[self._input] native_processor = MonthArchiveView() native_processor.year = year native_processor.month = month native_processor.month_format = "%m" native_processor.date_field = self._date_field native_processor.allow_future = self._allow_future native_processor.allow_empty = True native_processor.queryset = context[self._input] context[self._input] = native_processor.get_dated_items()[1] print context[self._input]
def get_context_data(self, **kwargs): context = MonthArchiveView.get_context_data(self, **kwargs) context['date_list'] = PostListView.queryset.dates('date_published', 'month') context['date_current'] = date(int(self.get_year()), int(self.get_month()), 1) return context
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'), )
#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'), )
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, name='print_invoice_booklet'), url(r'^send/(?P<invoice_id>\d+)/$', send_invoice, name='send_invoice'), )
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'), )
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')) ]
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), ), name='blog_entry_detail'), ]
from django.views.generic.list import ListView from day.models import Day from day.views import random_day_view, DayRedirectView, DayListView urlpatterns = patterns('', # /year/month/date => Story archive url(r'^(?P<year>\d+)/(?P<month>\d+)/(?P<day>\d+)/$', DayArchiveView.as_view(model=Day, month_format="%m", date_field="day", context_object_name="day_list", template_name='day/singleday_archive.html'), {}, name="day_day_archive"), # /year/month => List for that month url(r'^(?P<year>\d+)/(?P<month>\d+)/$', MonthArchiveView.as_view(model=Day, month_format="%m", date_field="day", context_object_name="day_list", template_name='day/archive.html'), {}, name="day_month_archive"), url(r'^list/$', DayListView.as_view(model=Day, context_object_name="day_list", template_name='day/archive.html'), {}, name="day_all_archive"), url(r'^$', TodayArchiveView.as_view(model=Day, date_field="day", context_object_name="day_list", template_name='day/singleday_archive.html'), {}, name="day_today"), # /day/random => random Day # TODO redo as a class-based view url(r'^random/$', random_day_view, {}, name="random_day"),
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'), )
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'), )
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'), )
} urlpatterns = patterns( '', # All Post Listing (r'^page(?P<page>[0-9]+)/$', PostListView.as_view()), url(r'^$', PostListView.as_view(), name='post_list'), # Yearly Archive url(r'^(?P<year>\d{4})/$', YearArchiveView.as_view(make_object_list=True, allow_future=True, **post_info_dict), name='post_list_by_year'), # Monthly Archive url(r'^(?P<year>\d{4})/(?P<month>\w{3})/$', MonthArchiveView.as_view(**post_info_dict), name='post_list_by_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_list_by_day'), # Post Detail Page url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(?P<slug>[-\w]+)$', PostDetailView.as_view(), name='post_detail'), )
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'), )
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,
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())), ]
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')) ]
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', month_format = '%m', paginate_by= 5, allow_empty= True, queryset= Noche.live.all()), name='noche_dia'), url(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$', DateDetailView.as_view( slug_field = 'slug',
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(), date_field='pub_date'), name='coltrane_entry_detail'), )
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]+)/$', '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',
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'), )
'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'), )
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'), )
# Teams url(r'^teams$', TeamListView.as_view(), name='team_list'), url(r'^team/(?P<pk>\d+)/$', TeamDetailView.as_view(), name='team_detail'), url(r'^team/(?P<pk>\d+)/matches$', TeamMatchListView.as_view(), name='team_match_detail'), # Matches 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'),
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', paginate_by= 5, allow_empty= True, queryset= Noticia.live.all()), name='noticia_dia'), url(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$', DateDetailView.as_view( slug_field = 'slug', date_field= 'fecha_publicacion',
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'), # Feeds url(r'^feeds/entries/$', LatestEntriesFeed(), name='latest-entries-feed'),
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', date_field='pub_date', month_format='%m'), name='blog_detail'), url(r'^$', 'ddtcms.blog.views.index', name='blog_index'), url(r'^post/$', 'ddtcms.blog.views.post'),
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'), )
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_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(slug_field='slug')), (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/$', DayArchiveView.as_view()), (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$', MonthArchiveView.as_view()), (r'^(?P<year>\d{4})/$', YearArchiveView.as_view, info_dict), (r'^rss/latest/$', RssBlogFeed), )
'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]+)/$',
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()), name='resumen_dia'), url( r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$', DateDetailView.as_view( slug_field='slug', date_field='fecha_publicacion',
urlpatterns = patterns('raptiye.blog.views', # main page of blog url(r'^$', ListView.as_view(**{ 'queryset': get_latest_entries(), 'template_name': '%s/homepage.html' % settings.TEMPLATE_NAME, 'paginate_by': settings.ENTRIES_PER_PAGE, 'context_object_name': 'entries' }), name='index'), # archives for blogs.. # url(r'^(?P<year>\d{4})/$', 'get_entries_for_year', name='entries_in_year'), url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/$', MonthArchiveView.as_view(**{ 'queryset': get_latest_entries(), 'date_field': 'datetime', 'month_format': '%m', 'allow_empty': True, 'context_object_name': "entries", 'allow_future': True, 'paginate_by': settings.ENTRIES_PER_PAGE, 'template_name': '%s/entries_in_month.html' % settings.TEMPLATE_NAME, }), name='entries_in_month'), url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/$', DayArchiveView.as_view(**{ 'queryset': get_latest_entries(), 'date_field': 'datetime', 'month_format': '%m', 'allow_empty': True, 'context_object_name': "entries", 'allow_future': True, 'paginate_by': settings.ENTRIES_PER_PAGE, 'template_name': '%s/entries_for_day.html' % settings.TEMPLATE_NAME, }), name='entries_on_date'), # an entry on a specific date
from django.conf.urls import patterns, include, url from django.views.generic import DetailView, ListView from django.views.generic.dates import MonthArchiveView from blog.models import Post from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^$', ListView.as_view( queryset=Post.objects.order_by('-created'), context_object_name='posts', template_name='blog_plus/post_list.html'), name="post_list"), url(r'^(?P<pk>\d+)/$', DetailView.as_view( model=Post, template_name='blog_plus/post_detail.html'), name="post_detail"), url(r'^monthly/$',MonthArchiveView.as_view( model=Post, date_field='created', context_object_name='posts', template_name='blog_plus/post_list.html'), name="month_archive"), )
allow_future=True, ), name="money-all", ), (r'^transactions/(?P<year>\d{4})/$', YearArchiveView.as_view( model=models.Transaction, date_field='date', make_object_list=True, template_name="money/transaction_archive.html", ) ), url(r'^transactions/(?P<year>\d{4})/(?P<month>\w{3})/$', MonthArchiveView.as_view( model=models.Transaction, date_field='date', template_name="money/transaction_archive.html", ), name="money-month-archive" ), url(r'^transactions/payday/(?P<year>\d{4})/(?P<month>\w{3})/$', views.SincePayDayArchiveView.as_view( model=models.Transaction, date_field='date', template_name="money/transaction_archive.html", ), name="money-month-archive" ), (r'^transactions/(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/$',