Source

django-field-attributes / README.md

About

Django application that can change the field widget attributes in place, compare widget class name.

Install

Clonning repository

hg clone https://bitbucket.org/amigo/django-field-attributes

Via package index

pip install django-field-attributes

Usage

Template example:

{% load field_attributes %}

{% field form.title class="announce" %}

{% field form.tags placeholder=form.tags.help_text %}

{% if form.title|is_widget:"TextInput" %}
    <h1>Title is TextInput</h1>
{% endif %}

{% if field|is_widget:"Textarea,TextInput" %}
    {% field field placeholder=field.help_text %}
{% endif %}