... 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() ... _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( ... 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 ... ... 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() ... _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( ... 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 ... ... neric.detail.SingleObjectMixin django.views.generic.edit.ProcessFormView django.views.generic.base.View 属性 template_name_suffix ¶ GET リクエストに描画された CreateView のページは、 '_form' の template_name_suffix を使います。 例えば、この属性をオブジ ... neric.detail.SingleObjectMixin django.views.generic.edit.ProcessFormView django.views.generic.base.View 属性 template_name_suffix ¶ GET リクエストに描画された UpdateView のページは、 '_form' の template_name_suffix を使います。 例えば、この属性をオブジ ... ew from myapp.models import Author class AuthorUpdateView ( UpdateView ): model = Author fields = [ "name" ] template_name_suffix = "_update_form" 例 myapp/author_update_form.html : < form method = "post" > {% csrf_token %} {{ form.as_p }} < input type ... ... neric.detail.SingleObjectMixin django.views.generic.edit.ProcessFormView django.views.generic.base.View 属性 template_name_suffix ¶ GET リクエストに描画された CreateView のページは、 '_form' の template_name_suffix を使います。 例えば、この属性をオブジ ... neric.detail.SingleObjectMixin django.views.generic.edit.ProcessFormView django.views.generic.base.View 属性 template_name_suffix ¶ GET リクエストに描画された UpdateView のページは、 '_form' の template_name_suffix を使います。 例えば、この属性をオブジ ... ew from myapp.models import Author class AuthorUpdateView ( UpdateView ): model = Author fields = [ "name" ] template_name_suffix = "_update_form" 例 myapp/author_update_form.html : < form method = "post" > {% csrf_token %} {{ form.as_p }} < input type ... ... 順で表示されます。 ノート デフォルトの context_object_name として latest を使います。 デフォルトの _archive の template_name_suffix を使います。 年によって date_list を提供する動作がデフォルトですが、 date_list_period 属性を用いた月や日に変更できます。こ ... ブジェクト。 previous_year : date オブジェクト。 allow_empty と allow_future に従います。 ノート デフォルトの template_name_suffix は _archive_year です。 例 myapp/views.py : from django.views.generic.dates import YearArchiveView from myapp.models impor ... s_month : allow_empty と allow_future に従って、前月の最初の日を表す date オブジェクト。 ノート デフォルトの template_name_suffix は _archive_month です。 例 myapp/views.py : from django.views.generic.dates import MonthArchiveView from myapp.models imp ... ... 、同じPythonプロセス内のすべての後続の ContactForm インスタンスに影響を与えます。 >>> f . base_fields [ "subject" ] . label_suffix = "?" >>> another_f = ContactForm ( auto_id = False ) >>> another_f . as_div () . split ( "</div>" )[ 0 ] '<div><label for ... リは auto_id が True の場合と同様に動作します。 デフォルトでは、 auto_id は文字列 'id_%s' がセットされています。 Form. label_suffix ¶ フォームをレンダリングする際、すべてのラベル名の後ろにつけられる翻訳可能な文字列の接尾語 (英語ではコロン ( : ) がデフォル ... ト) です。 その文字をカスタマイズしたり、完全に省略したりすることも、 label_suffix パラメータを使用して可能です。 >>> f = ContactForm ( auto_id = "id_for_ %s " , label_suffix = "" ) >>> print ( f ) <div><l ... ... 順で表示されます。 ノート デフォルトの context_object_name として latest を使います。 デフォルトの _archive の template_name_suffix を使います。 年によって date_list を提供する動作がデフォルトですが、 date_list_period 属性を用いた月や日に変更できます。こ ... ブジェクト。 previous_year : date オブジェクト。 allow_empty と allow_future に従います。 ノート デフォルトの template_name_suffix は _archive_year です。 例 myapp/views.py : from django.views.generic.dates import YearArchiveView from myapp.models impor ... s_month : allow_empty と allow_future に従って、前月の最初の日を表す date オブジェクト。 ノート デフォルトの template_name_suffix は _archive_month です。 例 myapp/views.py : from django.views.generic.dates import MonthArchiveView from myapp.models imp ... ... 、同じPythonプロセス内のすべての後続の ContactForm インスタンスに影響を与えます。 >>> f . base_fields [ "subject" ] . label_suffix = "?" >>> another_f = ContactForm ( auto_id = False ) >>> another_f . as_div () . split ( "</div>" )[ 0 ] '<div><label for ... リは auto_id が True の場合と同様に動作します。 デフォルトでは、 auto_id は文字列 'id_%s' がセットされています。 Form. label_suffix ¶ フォームをレンダリングする際、すべてのラベル名の後ろにつけられる翻訳可能な文字列の接尾語 (英語ではコロン ( : ) がデフォル ... ト) です。 その文字をカスタマイズしたり、完全に省略したりすることも、 label_suffix パラメータを使用して可能です。 >>> f = ContactForm ( auto_id = "id_for_ %s " , label_suffix = "" ) >>> print ( f ) <div><l ... ... he fetched rows to Model objects lazily by using the iterator() method. BoundField.label_tag now includes the form's label_suffix ¶ This is consistent with how methods like Form.as_p and Form.as_ul render labels. If you manually render label_tag in you ... ield" type = "text" name = "my_field" /> If you want to keep the current behavior of rendering label_tag without the label_suffix , instantiate the form label_suffix='' . You can also customize the label_suffix on a per-field basis using the new label_ ... text of model form fields for ManyToManyField fields QuerySet iteration BoundField.label_tag now includes the form's label_suffix Admin views _changelist_filters GET parameter django.contrib.auth password reset uses base 64 encoding of User PK Default ... ... <div>Your website:<input type="url" name="url"></div> <div>Comment:<input type="text" name="comment" required></div> label_suffix ¶ Field. label_suffix ¶ label_suffix 引数を使用すると、フォームの label_suffix をフィールドごとに上書きできます。 >>> clas ... IntegerField () ... nationality = forms . CharField () ... captcha_answer = forms . IntegerField ( label = "2 + 2" , label_suffix = " =" ) ... >>> f = ContactForm ( label_suffix = "?" ) >>> print ( f ) <div><label for="id_age">Age?</label><input type=" ... る例は、 BoundField のカスタマイズ を確認してください。 目次 フォーム フィールド field のコアとなる引数 required label label_suffix initial widget help_text error_messages validators localize disabled template_name bound_field_class フィールドのデータの変 ... 2026年10月08日