Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

Padraig

« Newer Snippets
Older Snippets »
1 total  XML / RSS feed 

For ubernostrum

Template (entries_archive_month.html):

<div id="content">
<h2>Archive: <a href="/blog/{{ month|date:"Y" }}/">{{ month|date:"Y" }}a> > {{ month|date:"F" }}</h2>
{% if object_list %}
    
    {% for entry in object_list %} <li><a href="{{ entry.get_absolute_url }}">{{ entry.title|title }}a></li> {% endfor %}
{% else %
} <p>No entries are available.p> {% endif %} </div>


urls.py:

from django.conf.urls.defaults import *

info_dict = {
    'app_label': 'blog',
    'module_name': 'entries',
    'date_field' : 'date_pub',
}

urlpatterns = patterns('',
    (r'^$', 'django.views.generic.date_based.archive_index', dict(info_dict,num_latest=5)),
    #(r'^$', 'pk.apps.blog.views.blog.index'),
    (r'^(?P\d{4})/(?P[a-z]{3})/(?P\d{2})/(?P[a-z0-9-]+)/$', 'django.views.generic.date_based.object_detail', dict(info_dict, slug_field='slug')),
    (r'^(?P\d{4})/(?P[a-z]{3})/$', 'django.views.generic.date_based.archive_month', info_dict),
    (r'^(?P\d{4})/$', 'django.views.generic.date_based.archive_year', info_dict),
    (r'^(?P\d{4})/(?P[a-z]{3})/(?P\d{2})/(?P[a-z0-9-]+)/comment/$', 'pk.apps.blog.views.blog.comment'),
    (r'^category/(?P\w+)/$', 'pk.apps.blog.views.blog.category'),
)
« Newer Snippets
Older Snippets »
1 total  XML / RSS feed