from django.conf.urls.defaults import * from jayparlar.papers.models import Paper, Author author_dict = { 'queryset': Author.objects.all(), } paper_dict = { 'queryset': Paper.objects.all(), } urlpatterns = patterns('django.views.generic.list_detail', (r'^authors/?$', 'object_list', dict(author_dict, template_name="papers/authors.html", allow_empty=True)), (r'^paper/(?P\d+)', 'object_detail', dict(paper_dict, template_name="papers/paper.html")), (r'^authors/(?P\d+)', 'object_detail', dict(author_dict, template_name="papers/author.html")), (r'^/?$', 'object_list', dict(paper_dict, template_name="papers/papers.html", allow_empty=True)), )