Задать вопрос

Тел: +7 965 3737 888

434

Просмотров

0

Ответов

Customizable newforms labels with a template tag

<p>This template tag and suggested template allow greater control over rendering &lt;label&gt; tags for your newforms fields than using field.label_tag.  I save the provided Python code in my app as templatetags/forms.py (although this name may conflict in the future).</p>
<p>The simplest usage:</p>
{% label field %}

<p>One use case is adding class="required" to the label tag for required fields instead of inserting markup elsewhere--this is done in the given example template.</p>
<p>Alternate label text and tag attributes can be passed to the inclusion tag:</p>
{% label field "Alt. label" 'class=one,id=mylabel' %}

Вопрос полезен? Да0/Нет0
file_4544.py(1001.0б)
None