| | 116 | ==== classmethod2 ==== |
| | 117 | |
| | 118 | [http://github.com/spookylukey/django-class-based-views/tree/classmethod2 Implementation]. |
| | 119 | |
| | 120 | Similar to classmethod, but `as_view` returns a view functions when called, and arguments to `__init__()` can be passed to the `as_view` call. |
| | 121 | |
| | 122 | Example usage: |
| | 123 | {{{ |
| | 124 | url(r'^detail/author/(?P<pk>\d+)/$', views.AuthorDetail.as_view(), name="author_detail"), |
| | 125 | url(r'^detail/author/(?P<pk>\d+)/foo/$', views.AuthorDetail.as_view(foo=True), name="author_detail"), |
| | 126 | }}} |
| | 127 | |
| | 128 | Arguments against: |
| | 129 | * The URLconf is slightly more verbose |
| | 130 | |
| | 131 | |