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

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

Uploaded Source

Built Distributions

django_pony_forms-0.3.6-py27-none-any.whl (7.0 kB view details)

Uploaded Python 2.7

django_pony_forms-0.3.6-py2.7.egg (10.0 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for django_pony_forms-0.3.6.tar.gz
Algorithm Hash digest
SHA256 803c9bce9e3dd78ff637b0eb76883e1ef97377a1cb9a96841fc1ada78d3f92c7
MD5 8271fe86602733b9a2fad9654d093d24
BLAKE2b-256 7dba15be8c19100e2cd49610981b8a96683500efa01dfc67052d5bbe66514848

See more details on using hashes here.

File details

Details for the file django_pony_forms-0.3.6-py27-none-any.whl.

File metadata

File hashes

Hashes for django_pony_forms-0.3.6-py27-none-any.whl
Algorithm Hash digest
SHA256 54cc8e4e7d11057223033124fcebb420b5d89411d2baf9d6572d5d013befdae5
MD5 ede9c6543ac4ca46970dc070af7f606d
BLAKE2b-256 e0fabf7f8de12937a7d34b760dd6a7ab4d30b5f5c7e91960b3ee15777accf17e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_pony_forms-0.3.6-py2.7.egg
Algorithm Hash digest
SHA256 6bbbfdcea0ec2e7991ab3592e5c6ef9a66c9557054259e2188ac51eb74a99b98
MD5 04aefd56e607dbad9f394158adf060db
BLAKE2b-256 80ab5b8f157aedfc76253d63ac8826a0dc47380e771bf7ab4cb66b6bdc845376

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