• <legend id='ps9AH'><style id='ps9AH'><dir id='ps9AH'><q id='ps9AH'></q></dir></style></legend>
  • <i id='ps9AH'><tr id='ps9AH'><dt id='ps9AH'><q id='ps9AH'><span id='ps9AH'><b id='ps9AH'><form id='ps9AH'><ins id='ps9AH'></ins><ul id='ps9AH'></ul><sub id='ps9AH'></sub></form><legend id='ps9AH'></legend><bdo id='ps9AH'><pre id='ps9AH'><center id='ps9AH'></center></pre></bdo></b><th id='ps9AH'></th></span></q></dt></tr></i><div id='ps9AH'><tfoot id='ps9AH'></tfoot><dl id='ps9AH'><fieldset id='ps9AH'></fieldset></dl></div>
    1. <small id='ps9AH'></small><noframes id='ps9AH'>

      <tfoot id='ps9AH'></tfoot>
      • <bdo id='ps9AH'></bdo><ul id='ps9AH'></ul>

        在 django Forms 中定义 css 类

        时间:2024-04-21

            <tfoot id='7Wg33'></tfoot>

              <bdo id='7Wg33'></bdo><ul id='7Wg33'></ul>
              • <i id='7Wg33'><tr id='7Wg33'><dt id='7Wg33'><q id='7Wg33'><span id='7Wg33'><b id='7Wg33'><form id='7Wg33'><ins id='7Wg33'></ins><ul id='7Wg33'></ul><sub id='7Wg33'></sub></form><legend id='7Wg33'></legend><bdo id='7Wg33'><pre id='7Wg33'><center id='7Wg33'></center></pre></bdo></b><th id='7Wg33'></th></span></q></dt></tr></i><div id='7Wg33'><tfoot id='7Wg33'></tfoot><dl id='7Wg33'><fieldset id='7Wg33'></fieldset></dl></div>

                <small id='7Wg33'></small><noframes id='7Wg33'>

                    <tbody id='7Wg33'></tbody>

                • <legend id='7Wg33'><style id='7Wg33'><dir id='7Wg33'><q id='7Wg33'></q></dir></style></legend>

                • 本文介绍了在 django Forms 中定义 css 类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  Assume I have a form

                  class SampleClass(forms.Form):
                      name = forms.CharField(max_length=30)
                      age = forms.IntegerField()
                      django_hacker = forms.BooleanField(required=False)
                  

                  Is there a way for me to define css classes on each field such that I can then use jQuery based on class in my rendered page?

                  I was hoping not to have to manually build the form.

                  解决方案

                  Answered my own question. Sigh

                  http://docs.djangoproject.com/en/dev/ref/forms/widgets/#django.forms.Widget.attrs

                  I didn't realize it was passed into the widget constructor.

                  这篇关于在 django Forms 中定义 css 类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:最喜欢的 Django Tips &amp;特征? 下一篇:pandas DataFrame 列中值的计数频率

                  相关文章

                  1. <i id='PmWxF'><tr id='PmWxF'><dt id='PmWxF'><q id='PmWxF'><span id='PmWxF'><b id='PmWxF'><form id='PmWxF'><ins id='PmWxF'></ins><ul id='PmWxF'></ul><sub id='PmWxF'></sub></form><legend id='PmWxF'></legend><bdo id='PmWxF'><pre id='PmWxF'><center id='PmWxF'></center></pre></bdo></b><th id='PmWxF'></th></span></q></dt></tr></i><div id='PmWxF'><tfoot id='PmWxF'></tfoot><dl id='PmWxF'><fieldset id='PmWxF'></fieldset></dl></div>
                  2. <small id='PmWxF'></small><noframes id='PmWxF'>

                  3. <tfoot id='PmWxF'></tfoot>
                    <legend id='PmWxF'><style id='PmWxF'><dir id='PmWxF'><q id='PmWxF'></q></dir></style></legend>
                        <bdo id='PmWxF'></bdo><ul id='PmWxF'></ul>