私はdjangoテンプレートのフィールドを表示および調整するためにdjangoウィジェットの微調整を使用しています。すべてが正常に機能していますが、レンダリング時の選択ボックスの場合、最初に表示される-----
値-----
は--Select a Country--
私の構文は次のようになります。
{{ form.countries }} // countries is a choice field, therefore it is displayed as a select box
変更が必要な場合は、次のようにします。
{{ form.countries|attr:"class:span6" }} //just for an example
これを行うのを手伝ってください、私はこれを試しました:
{{ form.countries|attr:"option:--Select a Country--" }}
私を助けてください!
編集していただければ幸いです。
ありがとう。