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.8 - 1.10 and Python 2.7, 3.3-3.5.

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.4.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distributions

django_pony_forms-0.4.0-py2.7.egg (4.9 kB view details)

Uploaded Source

django_pony_forms-0.4.0-py2-none-any.whl (6.2 kB view details)

Uploaded Python 2

File details

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

File metadata

File hashes

Hashes for django_pony_forms-0.4.0.tar.gz
Algorithm Hash digest
SHA256 ab4764c52822cbdcef3d4e8b48b1e6269f9aa05451ea0f66a37d1aef0a79f08b
MD5 5124f1d9235b2a9184864376d08a2b1c
BLAKE2b-256 353e05b114c9c0f2b5083545191c1bcefafccb4b99e74330cc1dca5f30234f86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_pony_forms-0.4.0-py2.7.egg
Algorithm Hash digest
SHA256 26c0d1fedac7e2710ffa520ef59228d628c03e033de0afc4522615b462894648
MD5 a0777684aab65066d0ec383c89dda66b
BLAKE2b-256 c5e767207c1ea1aee6286c0d166cc8267aa5a9952e0fbd63622dc79348d60139

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_pony_forms-0.4.0-py2-none-any.whl
Algorithm Hash digest
SHA256 20898ca9315facdc8267255763928f36f4f99ce665f6dd4a0944b652caad1bda
MD5 83e735ff9a11ad2dba978af7b924bb8e
BLAKE2b-256 b4f1f27ccd332fe490b613b3f7c031e2ac6b084cfd7b8cab674af83bad8c9ed4

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