Class-based generic views - flattened index¶
This index provides an alternate organization of the reference documentation for class-based views. For each view, the effective attributes and methods from the class tree are represented under that view. For the reference documentation organized by the class which defines the behavior, see Class-based views
Simple generic views¶
RedirectView¶
-
class
RedirectView
¶
Attributes (with optional accessor):
Methods
as_view()
delete()
dispatch()
get()
get_redirect_url()
head()
http_method_not_allowed()
options()
post()
put()
Detail Views¶
DetailView¶
-
class
DetailView
¶
Attributes (with optional accessor):
content_type
context_object_name
[get_context_object_name()
]http_method_names
model
pk_url_kwarg
queryset
[get_queryset()
]response_class
slug_field
[get_slug_field()
]slug_url_kwarg
template_name
[get_template_names()
]template_name_field
template_name_suffix
Methods
List Views¶
ListView¶
-
class
ListView
¶
Attributes (with optional accessor):
allow_empty
[get_allow_empty()
]content_type
context_object_name
[get_context_object_name()
]http_method_names
model
paginate_by
[get_paginate_by()
]paginator_class
queryset
[get_queryset()
]response_class
template_name
[get_template_names()
]template_name_suffix
Methods
Editing views¶
FormView¶
-
class
FormView
¶
Attributes (with optional accessor):
content_type
form_class
[get_form_class()
]http_method_names
initial
[get_initial()
]response_class
success_url
[get_success_url()
]template_name
[get_template_names()
]
Methods
CreateView¶
-
class
CreateView
¶
Attributes (with optional accessor):
content_type
context_object_name
[get_context_object_name()
]form_class
[get_form_class()
]http_method_names
initial
[get_initial()
]model
pk_url_kwarg
queryset
[get_queryset()
]response_class
slug_field
[get_slug_field()
]slug_url_kwarg
success_url
[get_success_url()
]template_name
[get_template_names()
]template_name_field
template_name_suffix
Methods
UpdateView¶
-
class
UpdateView
¶
Attributes (with optional accessor):
content_type
context_object_name
[get_context_object_name()
]form_class
[get_form_class()
]http_method_names
initial
[get_initial()
]model
pk_url_kwarg
queryset
[get_queryset()
]response_class
slug_field
[get_slug_field()
]slug_url_kwarg
success_url
[get_success_url()
]template_name
[get_template_names()
]template_name_field
template_name_suffix
Methods
DeleteView¶
-
class
DeleteView
¶
Attributes (with optional accessor):
content_type
context_object_name
[get_context_object_name()
]http_method_names
model
pk_url_kwarg
queryset
[get_queryset()
]response_class
slug_field
[get_slug_field()
]slug_url_kwarg
success_url
[get_success_url()
]template_name
[get_template_names()
]template_name_field
template_name_suffix
Methods
as_view()
delete()
dispatch()
get()
get_context_data()
get_object()
head()
http_method_not_allowed()
post()
render_to_response()
Date-based views¶
ArchiveIndexView¶
-
class
ArchiveIndexView
¶
Attributes (with optional accessor):
allow_empty
[get_allow_empty()
]allow_future
[get_allow_future()
]content_type
context_object_name
[get_context_object_name()
]date_field
[get_date_field()
]http_method_names
model
paginate_by
[get_paginate_by()
]paginator_class
queryset
[get_queryset()
]response_class
template_name
[get_template_names()
]template_name_suffix
Methods
YearArchiveView¶
-
class
YearArchiveView
¶
Attributes (with optional accessor):
allow_empty
[get_allow_empty()
]allow_future
[get_allow_future()
]content_type
context_object_name
[get_context_object_name()
]date_field
[get_date_field()
]http_method_names
make_object_list
[get_make_object_list()
]model
paginate_by
[get_paginate_by()
]paginator_class
queryset
[get_queryset()
]response_class
template_name
[get_template_names()
]template_name_suffix
year
[get_year()
]year_format
[get_year_format()
]
Methods
MonthArchiveView¶
-
class
MonthArchiveView
¶
Attributes (with optional accessor):
allow_empty
[get_allow_empty()
]allow_future
[get_allow_future()
]content_type
context_object_name
[get_context_object_name()
]date_field
[get_date_field()
]http_method_names
model
month
[get_month()
]month_format
[get_month_format()
]paginate_by
[get_paginate_by()
]paginator_class
queryset
[get_queryset()
]response_class
template_name
[get_template_names()
]template_name_suffix
year
[get_year()
]year_format
[get_year_format()
]
Methods
WeekArchiveView¶
-
class
WeekArchiveView
¶
Attributes (with optional accessor):
allow_empty
[get_allow_empty()
]allow_future
[get_allow_future()
]content_type
context_object_name
[get_context_object_name()
]date_field
[get_date_field()
]http_method_names
model
paginate_by
[get_paginate_by()
]paginator_class
queryset
[get_queryset()
]response_class
template_name
[get_template_names()
]template_name_suffix
week
[get_week()
]week_format
[get_week_format()
]year
[get_year()
]year_format
[get_year_format()
]
Methods
DayArchiveView¶
-
class
DayArchiveView
¶
Attributes (with optional accessor):
allow_empty
[get_allow_empty()
]allow_future
[get_allow_future()
]content_type
context_object_name
[get_context_object_name()
]date_field
[get_date_field()
]day
[get_day()
]day_format
[get_day_format()
]http_method_names
model
month
[get_month()
]month_format
[get_month_format()
]paginate_by
[get_paginate_by()
]paginator_class
queryset
[get_queryset()
]response_class
template_name
[get_template_names()
]template_name_suffix
year
[get_year()
]year_format
[get_year_format()
]
Methods
TodayArchiveView¶
-
class
TodayArchiveView
¶
Attributes (with optional accessor):
allow_empty
[get_allow_empty()
]allow_future
[get_allow_future()
]content_type
context_object_name
[get_context_object_name()
]date_field
[get_date_field()
]day
[get_day()
]day_format
[get_day_format()
]http_method_names
model
month
[get_month()
]month_format
[get_month_format()
]paginate_by
[get_paginate_by()
]paginator_class
queryset
[get_queryset()
]response_class
template_name
[get_template_names()
]template_name_suffix
year
[get_year()
]year_format
[get_year_format()
]
Methods
DateDetailView¶
-
class
DateDetailView
¶
Attributes (with optional accessor):
allow_future
[get_allow_future()
]content_type
context_object_name
[get_context_object_name()
]date_field
[get_date_field()
]day
[get_day()
]day_format
[get_day_format()
]http_method_names
model
month
[get_month()
]month_format
[get_month_format()
]pk_url_kwarg
queryset
[get_queryset()
]response_class
slug_field
[get_slug_field()
]slug_url_kwarg
template_name
[get_template_names()
]template_name_field
template_name_suffix
year
[get_year()
]year_format
[get_year_format()
]
Methods