Django-pony-forms helps you to write better html for your Django forms
Project description
Django pony forms
Django-pony-forms helps you to write better html for your Django forms.
Read the documentation on http://django_pony_forms.readthedocs.org/en/latest/index.html
1: Better form html by default
The 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 templates
You 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>
Requirements
The package is tested with Django 1.3 and 1.4.
Installation
Install the package:
$ pip install django_pony_forms
Add django_pony_forms to your installed apps in settings.py.
INSTALLED_APPS = ( .. 'django_pony_forms', )
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django_pony_forms-0.3.3.tar.gz
.
File metadata
- Download URL: django_pony_forms-0.3.3.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f0b7be25246347f26ab112a94602958bf7569fb8dd67e53331487693e226d6b |
|
MD5 | fb5b07ad4e7007967f5c8c09d0f5aa1e |
|
BLAKE2b-256 | 92cc6d7195d25f3dedd0ff750f1f4cfb7177687030aabf183dcd0083e2a52cd3 |