Skip to content

Commit

Permalink
Name the AuthorDetailView URL, and provide a target for one of the se…
Browse files Browse the repository at this point in the history
…ctions.
  • Loading branch information
jaylett committed Jun 7, 2012
1 parent e4d063b commit 58f6c49
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/topics/generic-class-based-views.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ more::
children of that class will also need to explictly set it after super if they
want to be sure to override all parents.

.. _generic-views-list-subsets:

Viewing subsets of objects
--------------------------

Expand Down Expand Up @@ -394,7 +396,11 @@ custom view:

urlpatterns = patterns('',
#...
**(r'^authors/(?P<pk>\\d+)/$', AuthorDetailView.as_view()),**
**url(
r'^authors/(?P<pk>\\d+)/$',
AuthorDetailView.as_view(),
name='author-detail'
),**
)

Then we'd write our new view -- ``get_object`` is the method that retrieves the
Expand Down

0 comments on commit 58f6c49

Please sign in to comment.