django_pony_forms

Helps you to write better HTML for your Django forms
Download

django_pony_forms Ranking & Summary

Advertisement

  • Rating:
  • License:
  • The Apache License 2.0
  • Price:
  • FREE
  • Publisher Name:
  • Marco Braak
  • Publisher web site:
  • https://github.com/mbraak/

django_pony_forms Tags


django_pony_forms Description

django-pony-forms is a Django app that helps you to write better HTML for your Django forms.Read the documentation on http://django_pony_forms.readthedocs.org/en/latest/index.html1: Better form html by defaultThe form html that Django produces is not very nice or useful. For example, the default output of a Django form is a table.Just mixin PonyFormMixin to produce better html:class ExampleForm(PonyFormMixin, forms.Form): name = forms.CharField()This produces the following html:< div class="form-row row-name" > < label for="id_name" >Name< /label > < input type="text" id="id_name" name="name" / >< /div >2. Write your own form templatesYou can also write your own form templates:class ExampleForm(PonyFormMixin, forms.Form): name = forms.CharField() form_template = 'my_form.html' row_template = 'my_row.html'my_form.html:< div class="my_form" > {{ hidden_fields }} {{ top_errors }} {{ rows }}< /div >The package is tested with Django 1.3 and 1.4.InstallationInstall the package: pip install django_pony_formsAdd django_pony_forms to your installed apps in settings.py.INSTALLED_APPS = ( .. 'django_pony_forms',)Product's homepage


django_pony_forms Related Software