... initial から取得し、それ以外の場合は Field.initial を参照します。呼び出し可能な値は評価されます。 It is recommended to use BoundField.initial over get_initial_for_field() because BoundField.initial has a simpler interface. Also, unlike get_initial_for_fiel ... d() , BoundField.initial caches its values. This is useful especially when dealing with callables whose return values can change (e.g. date ... t_initial_for_field ( f . fields [ "identifier" ], "identifier" ) UUID('1b411fab-844e-4dec-bd4f-e9b0495f04d0') >>> # Using BoundField.initial, for comparison >>> f [ "identifier" ] . initial UUID('28a09c59-5f00-4ed9-9179-a3b074fa9c30') >>> f [ "identifier" ... ... l のメソッド) aremove() (RelatedManager のメソッド) arg_joiner (Func の属性) args (ResolverMatch の属性) aria_describedby (BoundField の属性) arity (Func の属性) ArrayAgg (django.contrib.postgres.aggregates のクラス) ArrayField (django.contrib.postgres.fie ... () (Field のメソッド) as_div() (BaseFormSet のメソッド) (Form のメソッド) as_double() (Field のメソッド) as_field_group() (BoundField のメソッド) as_hidden() (BoundField のメソッド) as_int() (Field のメソッド) as_json() (Form.errors のメソッド) as_manager( ... ッド) as_vendorname() (django.db.models モジュール) as_view() (django.views.generic.base.View のクラスメソッド) as_widget() (BoundField のメソッド) asave() (Model のメソッド) asc() (Expression のメソッド) asend() (Signal のメソッド) asend_robust() (Signal の ... ... ) version = models . IntegerField () name = models . CharField ( max_length = 20 ) 詳細は 複合主キー を参照してください。 BoundField のオーバーライドの簡素化 Prior to version 5.2, overriding Field.get_bound_field() was the only option to use a custom Boun ... nderer.bound_field_class フォーム層で Form.bound_field_class フィールド層で Field.bound_field_class 例えば、 Form クラスの BoundField をカスタマイズするには、下記のように実装します。 from django import forms class CustomBoundField ( forms . BoundField ): c ... ult += f " { self . custom_class } " return result . strip () class CustomForm ( forms . Form ): bound_field_class = CustomBoundField name = forms . CharField ( label = "Your Name" , max_length = 100 , required = False , widget = forms . TextInput ( attrs ... ... に使用するテンプレートのデフォルト名。 デフォルトは "django/forms/formsets/div.html" テンプレートです。 field_template_name BoundField をレンダリングするために使用されるテンプレートのデフォルト名。 デフォルトは "django/forms/field.html" です。 bound_field_c ... lass プロジェクト全体でフォームフィールドを表現するために使用されるデフォルトのクラスです。 BoundField クラスのデフォルト。 このデフォルトクラスは、フォームごとに Form.bound_field_class を、フィールドごとに Field.bound_field_ ... ィールド関連または非表示フィールド関連の全エラー。 フィールドテンプレートで利用可能なコンテキスト フィールドテンプレートは、 BoundField.get_context() からコンテキストを受け取ります。デフォルトでは、フィールドは以下の値を含む辞書を受け取ります: field : BoundF ... ... a datetime value. MultiWidget.widgets now accepts a dictionary which allows customizing subwidget name attributes. The new BoundField.widget_type property can be used to dynamically adjust form rendering based upon the widget type. 国際化 (internationaliza ... xist in django.db.models.fields is removed. The compatibility imports of django.forms.utils.pretty_name() and django.forms.boundfield.BoundField in django.forms.forms are removed. The compatibility imports of Context , ContextPopException , and RequestCont ... ... ccessed by overriding bound_field_class or override Field.get_bound_field() if you need more flexibility when creating the BoundField : Field. get_bound_field ( form , field_name ) [ソース] Form のインスタンスとフィールド名を引数に取り、対応する BoundField ... インスタンスを返します。この返された BoundField は、テンプレート内でそのフィールドにアクセスする際に使用されます。 BoundField をオーバーライドする例は、 BoundField のカス ... ... ムからフィールドにアクセスする "clean" なデータにアクセスする フォームをHTMLとしてアウトプットする さらに詳細なアウトプット BoundField のカスタマイズ アップロードされたファイルをフォームにバインドする フォームをサブクラス化する フォームのプレフィックス フォ ... ... ry key ( #28047 ). Fixed empty POST data table appearing instead of "No POST data" in HTML debug page ( #28079 ). Restored BoundField s without any choices evaluating to True ( #28058 ). Prevented SessionBase.cycle_key() from losing session data if _sessio ... ... lowed dashes in top-level domain names of URLs checked by URLValidator to fix a regression in Django 1.8 ( #26204 ). Fixed BoundField to reallow slices of subwidgets ( #26267 ). Prevented ContentTypeManager instances from sharing their cache ( #26286 ). ... ... Comment:<input type="text" name="comment" size="40" required></div> attrs を使った HTML の id をセットすることもできます。 BoundField.id_for_label で例を参照してください。 ウィジェットのクラスにスタイルを設定する ウィジェットとともに、アセット ( css や jav ... タグで出力されます。 外側の <div> コンテナは、定義されている場合はウィジェットの id 属性を受け取り、定義されていない場合は BoundField.auto_id を受け取ります。 ラジオボタンをループ処理する際、 label タグと input タグはそれぞれ for 属性と id 属性を含みます。 ... / div > ... </ div > 外側の <div> コンテナは、定義されている場合はウィジェットの id 属性を受け取り、定義されていない場合は BoundField.auto_id を受け取ります。 RadioSelect のように、ウィジェットの選択肢ごとに個々のチェックボックスをループ処理できます。しかし ... 2026年10月08日