基于类的通用视图——扁平化索引
参见
提供了一个很好的界面来浏览内置的基于类的视图的类层次结构。
class View
属性 (有可选的存取器):
方法
dispatch()
head()
setup()
TemplateView
class TemplateView
属性 (有可选的存取器):
方法
dispatch()
get()
head()
http_method_not_allowed()
setup()
RedirectView
class RedirectView
属性 (有可选的存取器):
方法
delete()
dispatch()
get()
head()
options()
post()
put()
setup()
DetailView
class DetailView
属性 (有可选的存取器):
context_object_name
[]extra_context
model
query_pk_and_slug
- [
get_queryset()
] - [
render_to_response()
] - [
get_slug_field()
] template_engine
- [
get_template_names()
] template_name_suffix
方法
ListView
class ListView
属性 (有可选的存取器):
- [
get_allow_empty()
] context_object_name
[]extra_context
model
- [
get_ordering()
] - [
get_paginate_by()
] - [
get_paginate_orphans()
] queryset
[]response_class
[]template_engine
- [
get_template_names()
]
class FormView
属性 (有可选的存取器):
extra_context
- [
get_form_class()
] initial
[]prefix
[]response_class
[]success_url
[]template_engine
- [
get_template_names()
]
方法
CreateView
class CreateView
属性 (有可选的存取器):
context_object_name
[]extra_context
form_class
[]http_method_names
- [
get_initial()
] pk_url_kwarg
- [
get_prefix()
] queryset
[]response_class
[]slug_field
[]slug_url_kwarg
- [
get_success_url()
] template_name
[]template_name_field
方法
UpdateView
class UpdateView
属性 (有可选的存取器):
content_type
- [
get_context_object_name()
] fields
- [
get_form_class()
] initial
[]prefix
[]query_pk_and_slug
- [
get_queryset()
] - [
render_to_response()
] - [
get_slug_field()
] success_url
[]template_engine
- [
get_template_names()
] template_name_suffix
方法
dispatch()
form_valid()
get_context_data()
get_form_kwargs()
head()
http_method_not_allowed()
put()
render_to_response()
DeleteView
class DeleteView
属性 (有可选的存取器):
content_type
- [
get_context_object_name()
] http_method_names
pk_url_kwarg
queryset
[]response_class
[]slug_field
[]slug_url_kwarg
- [
get_success_url()
] template_name
[]template_name_field
方法
as_view()
delete()
get()
get_context_data()
head()
http_method_not_allowed()
post()
setup()
ArchiveIndexView
class ArchiveIndexView
属性 (有可选的存取器):
- [
get_allow_empty()
] - [
get_allow_future()
] context_object_name
[]date_field
[]extra_context
model
- [
get_ordering()
] - [
get_paginate_by()
] - [
get_paginate_orphans()
] queryset
[]response_class
[]template_engine
- [
get_template_names()
]
方法
class YearArchiveView
- [
get_allow_empty()
] - [
get_allow_future()
] context_object_name
[]date_field
[]extra_context
make_object_list
[]model
- [
get_ordering()
] - [
get_paginate_by()
] - [
get_paginate_orphans()
] queryset
[]response_class
[]template_engine
- [
get_template_names()
] year
[]year_format
[]
方法
MonthArchiveView
class MonthArchiveView
属性 (有可选的存取器):
- [
get_allow_empty()
] - [
get_allow_future()
] context_object_name
[]date_field
[]extra_context
model
- [
get_month()
] - [
get_month_format()
] - [
get_ordering()
] - [
get_paginate_by()
] - [
get_paginate_orphans()
] queryset
[]response_class
[]template_engine
- [
get_template_names()
] year
[]year_format
[]
方法
as_view()
get()
get_context_data()
get_dated_items()
get_paginator()
head()
http_method_not_allowed()
render_to_response()
WeekArchiveView
class WeekArchiveView
属性 (有可选的存取器):
allow_empty
[]allow_future
[]content_type
- [
get_context_object_name()
] - [
get_date_field()
] http_method_names
ordering
[]paginate_by
[]paginate_orphans
[]paginator_class
- [
get_queryset()
] - [
render_to_response()
] template_name
[]template_name_suffix
- [
get_week()
] - [
get_week_format()
] - [
get_year()
] - [
get_year_format()
]
方法
dispatch()
get()
get_date_list()
get_dated_queryset()
head()
http_method_not_allowed()
render_to_response()
DayArchiveView
class DayArchiveView
属性 (有可选的存取器):
allow_empty
[]allow_future
[]content_type
- [
get_context_object_name()
] - [
get_date_field()
] - [
get_day()
] - [
get_day_format()
] http_method_names
month
[]month_format
[]ordering
[]paginate_by
[]paginate_orphans
[]paginator_class
- [
get_queryset()
] - [
render_to_response()
] template_name
[]template_name_suffix
- [
get_year()
] - [
get_year_format()
]
方法
dispatch()
get()
get_date_list()
get_dated_queryset()
get_next_month()
get_previous_day()
head()
http_method_not_allowed()
render_to_response()
TodayArchiveView
class TodayArchiveView
属性 (有可选的存取器):
allow_empty
[]allow_future
[]content_type
- [
get_context_object_name()
] - [
get_date_field()
] - [
get_day()
] - [
get_day_format()
] http_method_names
month
[]month_format
[]ordering
[]paginate_by
[]paginate_orphans
[]paginator_class
- [
get_queryset()
] - [
render_to_response()
] template_name
[]template_name_suffix
- [
get_year()
] - [
get_year_format()
]
方法
dispatch()
get()
get_date_list()
get_dated_queryset()
get_next_month()
get_previous_day()
head()
http_method_not_allowed()
render_to_response()
class DateDetailView
属性 (有可选的存取器):
allow_future
[]content_type
- [
get_context_object_name()
] - [
get_date_field()
] - [
get_day()
] - [
get_day_format()
] http_method_names
month
[]month_format
[]pk_url_kwarg
queryset
[]response_class
[]slug_field
[]slug_url_kwarg
template_name
[]template_name_field
year
[]year_format
[]
方法