Changes between Version 11 and Version 12 of ClassBasedViews
- Timestamp:
- Oct 12, 2010, 1:02:19 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ClassBasedViews
v11 v12 26 26 27 27 === View instantiation and thread safety === 28 The [http://groups.google.com/group/django-developers/browse_thread/thread/e23d9a5a58fe5891 most recent django-developers discussion on the topic] discussed many of the available options on instantiating the views and protecting them from threading issues. Here is a summary of the various approaches that have been proposed. 28 The [http://groups.google.com/group/django-developers/browse_thread/thread/27cec79b784ef73f?hl=en1 most recent django-developers discussion on the topic], and [http://groups.google.com/group/django-developers/browse_thread/thread/e23d9a5a58fe589 an older thread] discussed many of the available options on instantiating the views and protecting them from threading issues. Here is a summary of the various approaches that have been proposed. 29 30 Some examples showing the essence of each of them without the other details: http://bitbucket.org/spookylukey/django-class-views-experiments/src/tip/ 29 31 30 32 ==== Store state on request, not view ==== … … 128 130 Arguments against: 129 131 * The URLconf is slightly more verbose 132 * If you do `AuthorDetail(foo=True).as_view()`, instead of `AuthorDetail.as_view(foo=True)`, you will not get an exception, but `foo=True` will effectively be ignored. 130 133 131 134 … … 151 154 ==== Recommendation ==== 152 155 153 Based on these discussions, plus in-person discussions at !DjangoCon.eu, `__copy__()` on `__call__()` appears to be a slight front runner, with `__new__()` as a close runner up.156 Based on these discussions, classmethod2 appears to be the winner. 154 157 155 158 === Class Hierarchy ===