Class-based generic views - flattened index
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.
See also
Classy Class-Based Views provides a nice interface to navigate the class hierarchy of the built-in class-based views.
Simple generic views
View
class View
Attributes (with optional accessor):
Methods
TemplateView
class TemplateView
Attributes (with optional accessor):
- content_type
- extra_context
- http_method_names
- response_class [render_to_response()]
- template_engine
- template_name [get_template_names()]
Methods
- as_view()
- dispatch()
get()- get_context_data()
head()- http_method_not_allowed()
- render_to_response()
- setup()
RedirectView
class RedirectView
Attributes (with optional accessor):
Methods
- as_view()
delete()- dispatch()
get()head()- http_method_not_allowed()
options()post()put()- setup()
Detail Views
DetailView
class DetailView
Attributes (with optional accessor):
- content_type
- context_object_name [get_context_object_name()]
- extra_context
- http_method_names
- model
- pk_url_kwarg
- query_pk_and_slug
- queryset [get_queryset()]
- response_class [render_to_response()]
- slug_field [get_slug_field()]
- slug_url_kwarg
- template_engine
- template_name [get_template_names()]
- template_name_field
- template_name_suffix
Methods
- as_view()
- dispatch()
- get()
- get_context_data()
- get_object()
head()- http_method_not_allowed()
- render_to_response()
- setup()
List Views
ListView
class ListView
Attributes (with optional accessor):
- allow_empty [get_allow_empty()]
- content_type
- context_object_name [get_context_object_name()]
- extra_context
- http_method_names
- model
- ordering [get_ordering()]
- paginate_by [get_paginate_by()]
- paginate_orphans [get_paginate_orphans()]
- paginator_class
- queryset [get_queryset()]
- response_class [render_to_response()]
- template_engine
- template_name [get_template_names()]
- template_name_suffix
Methods
- as_view()
- dispatch()
- get()
- get_context_data()
- get_paginator()
head()- http_method_not_allowed()
- paginate_queryset()
- render_to_response()
- setup()
Editing views
FormView
class FormView
Attributes (with optional accessor):
- content_type
- extra_context
- form_class [get_form_class()]
- http_method_names
- initial [get_initial()]
- prefix [get_prefix()]
- response_class [render_to_response()]
- success_url [get_success_url()]
- template_engine
- template_name [get_template_names()]
Methods
- as_view()
- dispatch()
- form_invalid()
- form_valid()
- get()
- get_context_data()
- get_form()
- get_form_kwargs()
- http_method_not_allowed()
- post()
- put()
- setup()
CreateView
class CreateView
Attributes (with optional accessor):
- content_type
- context_object_name [get_context_object_name()]
- extra_context
- fields
- form_class [get_form_class()]
- http_method_names
- initial [get_initial()]
- model
- pk_url_kwarg
- prefix [get_prefix()]
- query_pk_and_slug
- queryset [get_queryset()]
- response_class [render_to_response()]
- slug_field [get_slug_field()]
- slug_url_kwarg
- success_url [get_success_url()]
- template_engine
- template_name [get_template_names()]
- template_name_field
- template_name_suffix
Methods
- as_view()
- dispatch()
- form_invalid()
- form_valid()
- get()
- get_context_data()
- get_form()
- get_form_kwargs()
- get_object()
head()- http_method_not_allowed()
- post()
put()- render_to_response()
- setup()
UpdateView
class UpdateView
Attributes (with optional accessor):
- content_type
- context_object_name [get_context_object_name()]
- extra_context
- fields
- form_class [get_form_class()]
- http_method_names
- initial [get_initial()]
- model
- pk_url_kwarg
- prefix [get_prefix()]
- query_pk_and_slug
- queryset [get_queryset()]
- response_class [render_to_response()]
- slug_field [get_slug_field()]
- slug_url_kwarg
- success_url [get_success_url()]
- template_engine
- template_name [get_template_names()]
- template_name_field
- template_name_suffix
Methods
- as_view()
- dispatch()
- form_invalid()
- form_valid()
- get()
- get_context_data()
- get_form()
- get_form_kwargs()
- get_object()
head()- http_method_not_allowed()
- post()
put()- render_to_response()
- setup()
(本文超出站点单文档体积上限,已按小节截断)
