在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 教程/ Python/ 基于類(lèi)的通用視圖 —— 索引
點(diǎn)擊劫持保護(hù)
安全問(wèn)題歸檔
Model 類(lèi)參考
將遺留數(shù)據(jù)庫(kù)整合到Django
關(guān)聯(lián)對(duì)象參考
內(nèi)建基于類(lèi)的視圖的API
聚合
Django 中的用戶(hù)認(rèn)證
django.contrib.humanize
Django管理文檔生成器
分頁(yè)
使用Django輸出CSV
加密簽名
文件儲(chǔ)存API
安全
Django中的測(cè)試
國(guó)際化和本地化
為Django編寫(xiě)首個(gè)補(bǔ)丁
條件表達(dá)式
日志
模型元選項(xiàng)
部署靜態(tài)文件
執(zhí)行查詢(xún)
使用Django認(rèn)證系統(tǒng)
基于類(lèi)的視圖
中間件
編寫(xiě)自定義的django-admin命令
Django 的設(shè)置
格式本地化
數(shù)據(jù)庫(kù)訪(fǎng)問(wèn)優(yōu)化
錯(cuò)誤報(bào)告
基于類(lèi)的內(nèi)建通用視圖
編寫(xiě)自定義存儲(chǔ)系統(tǒng)
編寫(xiě)你的第一個(gè) Django 程序 第3部分
編寫(xiě)數(shù)據(jù)庫(kù)遷移
使用表單
編寫(xiě)你的第一個(gè) Django 程序 第2部分
編寫(xiě)你的第一個(gè) Django 程序 第1部分
如何使用會(huì)話(huà)
系統(tǒng)檢查框架
新手入門(mén)
信號(hào)
編寫(xiě)視圖
如何使用WSGI 部署
編寫(xiě)你的第一個(gè)Django應(yīng)用,第6部分
常見(jiàn)的網(wǎng)站應(yīng)用工具
Widgets
內(nèi)建的視圖
模型實(shí)例參考
視圖層
Django中的密碼管理
高級(jí)教程:如何編寫(xiě)可重用的應(yīng)用
國(guó)際化和本地化
"本地特色"附加功能
TemplateResponse 和 SimpleTemplateResponse
模式編輯器
文件上傳
快速安裝指南
部署 Django
表單 API
表單素材 ( <code>Media</code> 類(lèi))
管理文件
其它核心功能
查找 API 參考
表單
Admin
數(shù)據(jù)庫(kù)函數(shù)
自定義查找
使用基于類(lèi)的視圖處理表單
管理操作
開(kāi)發(fā)過(guò)程
編寫(xiě)你的第一個(gè)Django應(yīng)用,第5部分
進(jìn)行原始的sql查詢(xún)
模型層
多數(shù)據(jù)庫(kù)
編寫(xiě)你的第一個(gè) Django 程序 第4部分
Django安全
Django 初探
Django異常
重定向應(yīng)用
按需內(nèi)容處理
管理器
視圖裝飾器
驗(yàn)證器
使用Django輸出PDF
File對(duì)象
Django 的快捷函數(shù)
基于類(lèi)的通用視圖 —— 索引
為模型提供初始數(shù)據(jù)
模板層
URL調(diào)度器
中間件
模型

基于類(lèi)的通用視圖 —— 索引

這里的索引提供基于類(lèi)的視圖的另外一種組織形式。對(duì)于每個(gè)視圖,在類(lèi)繼承樹(shù)中有效的屬性和方法都顯示在該視圖的下方。按照行為進(jìn)行組織的文檔,參見(jiàn)基于類(lèi)的視圖。

簡(jiǎn)單的通用視圖

View

class View

屬性 (以及訪(fǎng)問(wèn)它們的方法):

  • http_method_names

方法

  • as_view()
  • dispatch()
  • head()
  • http_method_not_allowed()

TemplateView

class TemplateView

屬性 (以及訪(fǎng)問(wèn)它們的方法):

  • content_type
  • http_method_names
  • response_class [render_to_response()]
  • template_engine
  • template_name [get_template_names()]

方法

  • as_view()
  • dispatch()
  • get()
  • get_context_data()
  • head()
  • http_method_not_allowed()
  • render_to_response()

RedirectView

class RedirectView

屬性 (以及訪(fǎng)問(wèn)它們的方法):

  • http_method_names
  • pattern_name
  • permanent
  • query_string
  • url [get_redirect_url()]

方法

  • as_view()
  • delete()
  • dispatch()
  • get()
  • head()
  • http_method_not_allowed()
  • options()
  • post()
  • put()

明細(xì)視圖

DetailView

class DetailView

屬性 (以及訪(fǎng)問(wèn)它們的方法):

  • 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

方法

  • as_view()
  • dispatch()
  • get()
  • get_context_data()
  • get_object()
  • head()
  • http_method_not_allowed()
  • render_to_response()

清單視圖

ListView

class ListView

屬性 (以及訪(fǎng)問(wèn)它們的方法):

  • 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

方法

  • as_view()
  • dispatch()
  • get()
  • get_context_data()
  • get_paginator()
  • head()
  • http_method_not_allowed()
  • paginate_queryset()
  • render_to_response()

編輯視圖

FormView

class FormView

屬性 (以及訪(fǎng)問(wèn)它們的方法):

  • 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()]

方法

  • as_view()
  • dispatch()
  • form_invalid()
  • form_valid()
  • get()
  • get_context_data()
  • get_form()
  • get_form_kwargs()
  • http_method_not_allowed()
  • post()
  • put()

CreateView

class CreateView

屬性 (以及訪(fǎng)問(wèn)它們的方法):

  • 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

方法

  • 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()

UpdateView

class UpdateView

屬性 (以及訪(fǎng)問(wèn)它們的方法):

  • 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

方法

  • 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()

DeleteView

class DeleteView

屬性 (以及訪(fǎng)問(wèn)它們的方法):

  • 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
  • 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

class ArchiveIndexView

屬性 (以及訪(fǎng)問(wèn)它們的方法):

  • 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

方法

  • as_view()
  • dispatch()
  • get()
  • get_context_data()
  • get_date_list()
  • get_dated_items()
  • get_dated_queryset()
  • get_paginator()
  • head()
  • http_method_not_allowed()
  • paginate_queryset()
  • render_to_response()

YearArchiveView

class YearArchiveView

屬性 (以及訪(fǎng)問(wèn)它們的方法):

  • 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
  • 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()]

方法

  • as_view()
  • dispatch()
  • get()
  • get_context_data()
  • get_date_list()
  • get_dated_items()
  • get_dated_queryset()
  • get_paginator()
  • head()
  • http_method_not_allowed()
  • paginate_queryset()
  • render_to_response()

MonthArchiveView

class MonthArchiveView

屬性 (以及訪(fǎng)問(wèn)它們的方法):

  • 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()]
  • 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()]

方法

  • as_view()
  • dispatch()
  • get()
  • get_context_data()
  • get_date_list()
  • get_dated_items()
  • get_dated_queryset()
  • get_next_month()
  • get_paginator()
  • get_previous_month()
  • head()
  • http_method_not_allowed()
  • paginate_queryset()
  • render_to_response()

WeekArchiveView

class WeekArchiveView

屬性 (以及訪(fǎng)問(wèn)它們的方法):

  • 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
  • week [get_week()]
  • week_format [get_week_format()]
  • year [get_year()]
  • year_format [get_year_format()]

方法

  • as_view()
  • dispatch()
  • get()
  • get_context_data()
  • get_date_list()
  • get_dated_items()
  • get_dated_queryset()
  • get_paginator()
  • head()
  • http_method_not_allowed()
  • paginate_queryset()
  • render_to_response()

DayArchiveView

class DayArchiveView

屬性 (以及訪(fǎng)問(wèn)它們的方法):

  • 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()]
  • 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()]

方法

  • as_view()
  • dispatch()
  • get()
  • get_context_data()
  • get_date_list()
  • get_dated_items()
  • get_dated_queryset()
  • get_next_day()
  • get_next_month()
  • get_paginator()
  • get_previous_day()
  • get_previous_month()
  • head()
  • http_method_not_allowed()
  • paginate_queryset()
  • render_to_response()

TodayArchiveView

class TodayArchiveView

屬性 (以及訪(fǎng)問(wèn)它們的方法):

  • 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()]
  • 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()]

方法

  • as_view()
  • dispatch()
  • get()
  • get_context_data()
  • get_date_list()
  • get_dated_items()
  • get_dated_queryset()
  • get_next_day()
  • get_next_month()
  • get_paginator()
  • get_previous_day()
  • get_previous_month()
  • head()
  • http_method_not_allowed()
  • paginate_queryset()
  • render_to_response()

DateDetailView

class DateDetailView

屬性 (以及訪(fǎng)問(wèn)它們的方法):

  • 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 [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()]

方法

  • as_view()
  • dispatch()
  • get()
  • get_context_data()
  • get_next_day()
  • get_next_month()
  • get_object()
  • get_previous_day()
  • get_previous_month()
  • head()
  • http_method_not_allowed()
  • render_to_response()

譯者:Django 文檔協(xié)作翻譯小組,原文:Flattened index

本文以 CC BY-NC-SA 3.0 協(xié)議發(fā)布,轉(zhuǎn)載請(qǐng)保留作者署名和文章出處。

Django 文檔協(xié)作翻譯小組人手緊缺,有興趣的朋友可以加入我們,完全公益性質(zhì)。交流群:467338606。