bmihelac / django-uni-form-contrib

Contributed templates for Django Uni-Form

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

django-uni-form Contrib Templates

What

This is my fork with additional features:

  • twitter_bootstrap is a django app now, makes it uneccessary to copy templates manually
  • added custom renderer that adds inputs-list class to radio fields

Contributed templates for Daniel Greenfeld and Miguel Araujo's awesome django-uni-form library. Template sets are named for the library they relate to.

How

Install:

pip install -e git://github.com/bmihelac/django-uni-form-contrib.git@next#egg=uni_form_contrib

Add uni_form_contrib.twitter_bootstrap application to INSTALLED_APPS in settings.py before uni_form so django will pick this templates instead of default uni_form templates.

Widgets

For list of options, Bootstrap expect list tag to have a inputs-list class. BootstrapRadioFieldRenderer makes it easy to add css class::

from uni_form_contrib.twitter_bootstrap.widgets import BootstrapRadioFieldRenderer

field = forms.ChoiceField(label=_('field'),
        choices=FIELD_CHOICES,
        widget=forms.widgets.RadioSelect(renderer=BootstrapRadioFieldRenderer)
        )

Who

Current contributors are:

License

All templates are released under the MIT license.

About

Contributed templates for Django Uni-Form