Overview

About

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

Install

Cloning repository

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

Via package index

pip install django-field-attributes

Add to INSTALLED_APPS

INSTALLED_APPS += ('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_name|is_widget:"Textarea,TextInput" %}
    {% field field_name placeholder=field_name.help_text %}
{% endif %}