エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
FormFieldのlabel属性にhtmlタグを入れる - メモ置き場
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
FormFieldのlabel属性にhtmlタグを入れる - メモ置き場
そんなことをしなきゃいけないケースはほとんどないけど一応メモしておく。 試しに<br/ >を入れてみる c... そんなことをしなきゃいけないケースはほとんどないけど一応メモしておく。 試しに<br/ >を入れてみる class SampleForm(forms.Form): sample_field = forms.CharField(label=u"abc<br/ >xyz") これだとhtmlがエスケープされるので改行にならない from app.student.forms import SampleForm from django.template import Context, Template form = SampleForm() context = Context(dict(form=form)) print Template("{{ form }}").render(context) # => u'<tr><th><label for="id_sample_field">abc<