Skip to content

Commit

Permalink
Documentation in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbgk committed Sep 30, 2010
1 parent cbbbee3 commit b46faf4
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions README.md
@@ -1,4 +1,4 @@
django-class-based-views
Django class-based views
========================

Work on [ticket #6735](http://code.djangoproject.com/ticket/6735).
Expand All @@ -8,20 +8,35 @@ Installation

$ python setup.py install

Or for the moment:

$ pip install -e git@github.com:bfirsh/django-class-based-views.git#egg=django-cbv


Usage
-----

Inherit your own class-based views from existing ones listed below.

Declare your view in your URLs like you already do for classic views:

import views
from django.conf.urls.defaults import *

urlpatterns = patterns('',
url(r'^detail/author/(?P<pk>\d+)/$',
views.AuthorDetail(),
name="author_detail"),
)

Note: you must declare an **instance** of the class in your URLs, not the
class in order to avoid shared attributes across requests.


Views
-----

CRUD views
~~~~~~~~~~
### CRUD views

* ListView: Render some list of objects, set by `self.queryset`.
This can be any iterable of items, not just a queryset.
Expand All @@ -37,8 +52,7 @@ CRUD views
* DeleteView: View for deleting an object retrieved with `self.get_object()`.


Extra views
~~~~~~~~~~~
### Extra views

* PaginatedListView
* ProcessFormView
Expand All @@ -47,8 +61,7 @@ Extra views
* DisplayModelFormView


Date-based views
~~~~~~~~~~~~~~~~
### Date-based views

* ArchiveView
* YearView
Expand Down

0 comments on commit b46faf4

Please sign in to comment.