基于类的通用视图——扁平化索引
参见
基于类的经典视图 提供了一个很好的界面来浏览内置的基于类的视图的类层次结构。
class View
属性 (有可选的存取器):
方法
TemplateView
class TemplateView
属性 (有可选的存取器):
方法
- dispatch()
get()
head()
- http_method_not_allowed()
- setup()
RedirectView
class RedirectView
属性 (有可选的存取器):
方法
- as_view()
delete()
get()
- http_method_not_allowed()
options()
post()
put()
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
属性 (有可选的存取器):
- allow_empty []
- content_type
- [get_context_object_name()]
- http_method_names
- ordering []
- paginate_by []
- paginate_orphans []
- paginator_class
- [get_queryset()]
- [render_to_response()]
- template_name []
- template_name_suffix
class FormView
属性 (有可选的存取器):
- content_type
- form_class []
- http_method_names
- [get_initial()]
- [get_prefix()]
- [render_to_response()]
- [get_success_url()]
- template_name []
方法
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
属性 (有可选的存取器):
- 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
方法
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
属性 (有可选的存取器):
- 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
方法
- dispatch()
get()
- get_date_list()
- get_dated_queryset()
head()
- http_method_not_allowed()
- render_to_response()
class YearArchiveView
- allow_empty []
- allow_future []
- content_type
- [get_context_object_name()]
- [get_date_field()]
- http_method_names
- [get_make_object_list()]
- 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()
head()
- http_method_not_allowed()
- render_to_response()
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
属性 (有可选的存取器):
- [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()]
- week []
- week_format []
- year []
- year_format []
方法
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
属性 (有可选的存取器):
- [get_allow_empty()]
- [get_allow_future()]
- context_object_name []
- date_field []
- day []
- day_format []
- 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_next_day()
- get_paginator()
- get_previous_month()
head()
- paginate_queryset()
- setup()
class DateDetailView
属性 (有可选的存取器):
- [get_allow_future()]
- context_object_name []
- date_field []
- day []
- day_format []
- extra_context
- model
- [get_month()]
- [get_month_format()]
- query_pk_and_slug
- [get_queryset()]
- [render_to_response()]
- [get_slug_field()]
- template_engine
- [get_template_names()]
- template_name_suffix
- [get_year()]
- [get_year_format()]
方法