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.7 - 1.9 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.3.9.tar.gz (4.9 kB view details)

Uploaded Source

Built Distributions

django_pony_forms-0.3.9-py2.7.egg (9.7 kB view details)

Uploaded Source

django_pony_forms-0.3.9-py2-none-any.whl (6.5 kB view details)

Uploaded Python 2

File details

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

File metadata

File hashes

Hashes for django_pony_forms-0.3.9.tar.gz
Algorithm Hash digest
SHA256 c109815f9037f7779d9f732e0e37a05137cd24ccb8ad6b8c0af4bab2c385fc44
MD5 83da1daa4a57894c25ec7eab9827534e
BLAKE2b-256 eccacfe89b47f71185a91ed81e9b52a5104ec6e57b0cca1269eb09394e037697

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_pony_forms-0.3.9-py2.7.egg
Algorithm Hash digest
SHA256 831def5200e403e133280a102823c42fee9121c9d0d81c497913b023daeb19bb
MD5 e7fab3525b5a833850e05f1318e39164
BLAKE2b-256 29ffeda33c8eaa323c313a318b002cacee5d931efed3322ff8b9e30e07b7d934

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_pony_forms-0.3.9-py2-none-any.whl
Algorithm Hash digest
SHA256 91bb22ca40b8a78125a1bf2a7bb90e4522c2a759a02e5e8a4588dbc63e034466
MD5 185cc12194f7583c4835a8488f4a1921
BLAKE2b-256 dc33ee5a3d3be86b2d473e78c75c5bb734f0367ba229f43df2e4d9b221275383

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