Skip to main content

Django-pony-forms helps you to write better html for your Django forms

Project description

Django-pony-forms helps you to write better html for your Django forms.

Read the documentation on readthedocs

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.4 - 1.7 and Python 2.6, 2.7, 3.3 and 3.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_pony_forms-0.3.7.tar.gz (5.5 kB view details)

Uploaded Source

Built Distributions

django_pony_forms-0.3.7-py2.7.egg (10.3 kB view details)

Uploaded Source

django_pony_forms-0.3.7-py2-none-any.whl (7.2 kB view details)

Uploaded Python 2

File details

Details for the file django_pony_forms-0.3.7.tar.gz.

File metadata

File hashes

Hashes for django_pony_forms-0.3.7.tar.gz
Algorithm Hash digest
SHA256 d54850a0185501db95b050d5a8499631b6d19ded7de64803e91f2b3f83ca8d2a
MD5 fe13567c31b33263acf8d48b5ac472a0
BLAKE2b-256 159aa65c77ba16fe16038341f801d5dcab6994ff37062a5d346f053625d243a1

See more details on using hashes here.

File details

Details for the file django_pony_forms-0.3.7-py2.7.egg.

File metadata

File hashes

Hashes for django_pony_forms-0.3.7-py2.7.egg
Algorithm Hash digest
SHA256 d74264e450ed174509d201bf30446829384eed943703442efebf3576dc279510
MD5 45a757da1bfc37df0fba1d0e5d4d3a73
BLAKE2b-256 b25decc7ee4340d24dd8d49c1e4e966c766a4be7c0d0b0df0b1284cd073f9c84

See more details on using hashes here.

File details

Details for the file django_pony_forms-0.3.7-py2-none-any.whl.

File metadata

File hashes

Hashes for django_pony_forms-0.3.7-py2-none-any.whl
Algorithm Hash digest
SHA256 5d37722a41ec0510583449c5bc750e519be823fd20fbecf19e65f3f35411009b
MD5 f992767b4b1cbccfdd927a05e120f2e8
BLAKE2b-256 f31620b9c676eff29875dc71b598400585d76e3441acba5ff4821f20d9a2ba60

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page