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

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

基于類的通用視圖 —— 索引

這里的索引提供基于類的視圖的另外一種組織形式。對于每個視圖,在類繼承樹中有效的屬性和方法都顯示在該視圖的下方。按照行為進行組織的文檔,參見基于類的視圖。

簡單的通用視圖

View

class View

屬性 (以及訪問它們的方法):

  • http_method_names

方法

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

TemplateView

class TemplateView

屬性 (以及訪問它們的方法):

  • 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

屬性 (以及訪問它們的方法):

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

明細視圖

DetailView

class 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

方法

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

清單視圖

ListView

class 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

方法

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

編輯視圖

FormView

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

方法

  • 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

屬性 (以及訪問它們的方法):

  • 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

屬性 (以及訪問它們的方法):

  • 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

屬性 (以及訪問它們的方法):

  • 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

屬性 (以及訪問它們的方法):

  • 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

屬性 (以及訪問它們的方法):

  • 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

屬性 (以及訪問它們的方法):

  • 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

屬性 (以及訪問它們的方法):

  • 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

屬性 (以及訪問它們的方法):

  • 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

屬性 (以及訪問它們的方法):

  • 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

屬性 (以及訪問它們的方法):

  • 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)載請保留作者署名和文章出處。

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