diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-04-06 21:24:33 +0000 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-04-06 21:24:33 +0000 |
| commit | 8663bc110305844b2f8b0829ee2ddfc5be61b758 (patch) | |
| tree | cf59ad66ba09f07bb9ac17161f260be636e63e9a /docs/topics | |
| parent | b4a98271339e1595fc5e362da0d1b82b3c492448 (diff) | |
Fixed #16074 -- Added ContextMixin to class-based generic views to handle get_context_data. Thanks emyller, Luke Plant, Preston Holmes for working on the ticket and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17875 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/topics')
| -rw-r--r-- | docs/topics/class-based-views.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/topics/class-based-views.txt b/docs/topics/class-based-views.txt index 8059ed1df2..e1e2618478 100644 --- a/docs/topics/class-based-views.txt +++ b/docs/topics/class-based-views.txt @@ -270,6 +270,16 @@ more:: context['book_list'] = Book.objects.all() return context +.. note:: + + Generally, get_context_data will merge the context data of all parent classes + with those of the current class. To preserve this behavior in your own classes + where you want to alter the context, you should be sure to call + get_context_data on the super class. When no two classes try to define the same + key, this will give the expected results. However if any class attempts to + override a key after parent classes have set it (after the call to super), any + children of that class will also need to explictly set it after super if they + want to be sure to override all parents. Viewing subsets of objects -------------------------- |
