Chapter 11: Generic Views - 0 views
-
from django.conf.urls.defaults import * from django.views.generic import list_detail from mysite.books.models import Publisher publisher_info = { 'queryset': Publisher.objects.all(), 'template_name': 'publisher_list_page.html', } urlpatterns = patterns('', (r'^publishers/$', list_detail.object_list, publisher_info) )
-
That’s really all there is to it. All the cool features of generic views come from changing the “info” dictionary passed to the generic view.
-
You might have noticed that sample publisher list template stores all the books in a variable named object_list.
- ...10 more annotations...