这里的索引提供基于类的视图的另外一种组织形式。 对于每个视图,在类继承树中有效的属性和方法都显示在该视图的下方。 对于由定义行为的类组织的参考文档,请参阅Class-based views。
请参见
基于类的基于视图的视图提供了一个很好的界面来浏览内置的基于类视图的类层次结构。
TemplateView
¶ TemplateView T0> ¶ T1>
属性(带可选访问器):
内容类型
http_method_names
response_class
[render_to_response()
]template_engine
template_name
[get_template_names()
]方法
RedirectView
¶ RedirectView的 T0> ¶ T1>
属性(带可选访问器):
方法
as_view()
delete()
dispatch()
get()
head()
http_method_not_allowed()
options()
post()
put()
DetailView
¶DetailView
¶属性(带可选访问器):
content_type --内容类型
context_object_name
[get_context_object_name()
]http_method_names
model
pk_url_kwarg
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
方法
ListView
¶ListView
¶属性(带可选访问器):
allow_empty
[get_allow_empty()
]content_type
context_object_name
[get_context_object_name()
]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
方法
FormView
¶FormView
¶属性(带可选访问器):
content_type
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()
]方法
CreateView
¶CreateView
¶属性(带可选访问器):
content_type
context_object_name
[get_context_object_name()
]fields
form_class
[get_form_class()
]http_method_names
initial
[get_initial()
]model
pk_url_kwarg
prefix
[get_prefix()
]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
方法
UpdateView
¶UpdateView
¶属性(带可选访问器):
content_type
context_object_name
[get_context_object_name()
]fields
form_class
[get_form_class()
]http_method_names
initial
[get_initial()
]model
pk_url_kwarg
prefix
[get_prefix()
]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
方法
DeleteView
¶DeleteView
¶属性(带可选访问器):
内容类型
context_object_name
[get_context_object_name()
]http_method_names
model
pk_url_kwarg
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
方法
as_view()
delete()
dispatch()
get()
get_context_data()
get_object()
head()
http_method_not_allowed()
post()
render_to_response()
ArchiveIndexView
¶ ArchiveIndexView T0> ¶ T1>
属性(带可选访问器):
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
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
方法
YearArchiveView
¶ YearArchiveView T0> ¶ T1>
属性(带可选访问器):
allow_empty
[get_allow_empty()
]allow_future
[get_allow_future()
]内容类型
context_object_name
[get_context_object_name()
]date_field
[get_date_field()
]http_method_names
make_object_list
[get_make_object_list()
]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
year
[get_year()
]year_format
[get_year_format()
]方法
MonthArchiveView
¶ MonthArchiveView T0> ¶ T1>
属性(带可选访问器):
allow_empty
[get_allow_empty()
]allow_future
[get_allow_future()
]内容类型
context_object_name
[get_context_object_name()
]date_field
[get_date_field()
]http_method_names
model
month
[get_month()
]month_format
[get_month_format()
]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
year
[get_year()
]year_format
[get_year_format()
]方法
WeekArchiveView
¶ WeekArchiveView T0> ¶ T1>
属性(带可选访问器):
allow_empty
[get_allow_empty()
]allow_future
[get_allow_future()
]内容类型
context_object_name
[get_context_object_name()
]date_field
[get_date_field()
]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
week
[get_week()
]week_format
[get_week_format()
]year
[get_year()
]year_format
[get_year_format()
]方法
DayArchiveView
¶ DayArchiveView T0> ¶ T1>
属性(带可选访问器):
allow_empty
[get_allow_empty()
]allow_future
[get_allow_future()
]内容类型
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()
]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
year
[get_year()
]year_format
[get_year_format()
]方法
TodayArchiveView
¶ TodayArchiveView T0> ¶ T1>
属性(带可选访问器):
allow_empty
[get_allow_empty()
]allow_future
[get_allow_future()
]内容类型
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()
]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
year
[get_year()
]year_format
[get_year_format()
]方法
DateDetailView
¶ DateDetailView T0> ¶ T1>
属性(带可选访问器):
allow_future
[get_allow_future()
]内容类型
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
[render_to_response()
]slug_field
[get_slug_field()
]slug_url_kwarg
template_engine
template_name
[get_template_names()
]template_name_field
template_name_suffix
year
[get_year()
]year_format
[get_year_format()
]方法
2017年9月6日