~ubuntu-branches/ubuntu/quantal/python-django/quantal-security

« back to all changes in this revision

Viewing changes to docs/topics/generic-views.txt

  • Committer: Bazaar Package Importer
  • Author(s): Chris Lamb
  • Date: 2010-05-21 07:52:55 UTC
  • mfrom: (1.3.6 upstream)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: james.westby@ubuntu.com-20100521075255-ii78v1dyfmyu3uzx
Tags: upstream-1.2
ImportĀ upstreamĀ versionĀ 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
        ('^about/$', direct_to_template, {
81
81
            'template': 'about.html'
82
82
        }),
83
 
        **('^about/(\w+)/$', about_pages),**
 
83
        **('^about/(\\w+)/$', about_pages),**
84
84
    )
85
85
 
86
86
Next, we'll write the ``about_pages`` view::
382
382
 
383
383
    urlpatterns = patterns('',
384
384
        (r'^publishers/$', list_detail.object_list, publisher_info),
385
 
        **(r'^books/(\w+)/$', books_by_publisher),**
 
385
        **(r'^books/(\\w+)/$', books_by_publisher),**
386
386
    )
387
387
 
388
388
Next, we'll write the ``books_by_publisher`` view itself::
453
453
 
454
454
    urlpatterns = patterns('',
455
455
        #...
456
 
        **(r'^authors/(?P<author_id>\d+)/$', author_detail),**
 
456
        **(r'^authors/(?P<author_id>\\d+)/$', author_detail),**
457
457
    )
458
458
 
459
459
Then we'd write our wrapper function::