HTTPS clone URL

Subversion checkout URL

Django forms are easily rendered as tables, paragraphs, and unordered lists. However, elegantly rendered div based forms is something you have to do by hand. The purpose of this application is to provide a simple tag and/or filter that lets you quickly render forms in a div format.

README.rst

django-uni-form (django-uni-form)

Django forms are easily rendered as tables,
paragraphs, and unordered lists. However, elegantly rendered div based forms
is something you have to do by hand. The purpose of this application is to
provide a simple tag and/or filter that lets you quickly render forms in a div
format.

Uni-form has been selected as the base model for the design of the forms.

Warning: django-uni-form 0.8 and higher renders django.form.field labels with the 'safe' filter. If you have user generated form field labels you should take this into consideration.

Note: django-uni-form 0.8 and higher lays out the HTML for the uni_form tag differently than previous versions. The errorMsg div is now outside the fieldset as it should be.

Note: django-uni-form 0.7 and higher breaks backwards compatibility with previous versions of django-uni-form. All you have to do is update templates that call on the django-uni-form template tag from:

{% load uni_form %}

To:

{% load uni_form_tags %}

Installation

Dependencies

JQuery 1.2.6

Installing django-uni-form

Install into your python path using pip or easy_install:

pip install django-uni-form
easy_install django-uni-form

Add 'uni_form' to your INSTALLED_APPS in settings.py:

INSTALLED_APPS = (
...
'uni_form',
)

Depending on your setup, you may need to copy the media files to your local
media folder:

Customizations on '*' required fields (optional)

If you don't like the use of '*' (asterisk) to denote required fields you can simply overrride the django-uni-form field.html. In your Django project's templates directory create a new directory called uni_form. Copy the django-uni-form field.html file to that directory and make the desired changes. For example:

Now you could change the asterisk to any other character, an image icon, or whatever else you want.

Using Uni-Form strict fields

django-uni-form implements form fields in html differently than the standard Uni-Form. If you want to adhere to the strict definition of django-uni-form relplace the field.html file with field.strict.html. You can just follow these instructions: