• <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 类

        Define css class in django Forms(在 django Forms 中定义 css 类)

            <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 类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  groupby multiple coords along a single dimension in xarray(在xarray中按单个维度的多个坐标分组)
                  Group by and Sum in Pandas without losing columns(Pandas中的GROUP BY AND SUM不丢失列)
                  Group by + New Column + Grab value former row based on conditionals(GROUP BY+新列+基于条件的前一行抓取值)
                  Groupby and interpolate in Pandas(PANDA中的Groupby算法和插值算法)
                  Pandas - Group Rows based on a column and replace NaN with non-null values(PANAS-基于列对行进行分组,并将NaN替换为非空值)
                  Grouping pandas DataFrame by 10 minute intervals(按10分钟间隔对 pandas 数据帧进行分组)

                    • <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>
                      • <small id='PmWxF'></small><noframes id='PmWxF'>

                      • <tfoot id='PmWxF'></tfoot>
                          <tbody id='PmWxF'></tbody>
                        <legend id='PmWxF'><style id='PmWxF'><dir id='PmWxF'><q id='PmWxF'></q></dir></style></legend>
                            <bdo id='PmWxF'></bdo><ul id='PmWxF'></ul>