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

Uploaded Source

Built Distributions

django_pony_forms-0.3.8-py2.7.egg (9.3 kB view details)

Uploaded Source

django_pony_forms-0.3.8-py2-none-any.whl (6.4 kB view details)

Uploaded Python 2

File details

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

File metadata

File hashes

Hashes for django_pony_forms-0.3.8.tar.gz
Algorithm Hash digest
SHA256 eb3630d23bfd748330abfbe2893f92f5ecf6a9096d468dda3b04ee9587c3fbd6
MD5 b52913f33afd1c03413cdecc686cb042
BLAKE2b-256 a52ede47e5896459507b4f19b905d34a490021126f5f52c36d77684932df020d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_pony_forms-0.3.8-py2.7.egg
Algorithm Hash digest
SHA256 4c25cfa1fa55712d42a017e57aa9e7ca8431b76f03ec37a25b4ea5351fc22b84
MD5 3a2d6af405f4a04d64870098104d3fcb
BLAKE2b-256 901923f475191aa15e926f0bf373496ac183eadd99a453f41eeea998c5389141

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_pony_forms-0.3.8-py2-none-any.whl
Algorithm Hash digest
SHA256 339c983218d314eb68a1e1b90243d991e7a26ce3c78b15a9b75a12892bc4c1a0
MD5 5583163e5e50dd85523159a6763b3ed9
BLAKE2b-256 701cb3731a6296b8ce6abe21688710ad2120062f6c80cbd627fba6432240372a

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