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


Release history Release notifications

History Node

0.5.0

History Node

0.4.1

History Node

0.4.0

History Node

0.3.9

History Node

0.3.8

History Node

0.3.7

This version
History Node

0.3.6

History Node

0.3.5

History Node

0.3.4

History Node

0.3.3.3

History Node

0.3.3.2

History Node

0.3.3.1

History Node

0.3.3

History Node

0.3.2

History Node

0.3.1

History Node

0.3.0.2

History Node

0.3.0.1

History Node

0.3

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
django_pony_forms-0.3.6-py2.7.egg (10.0 kB) Copy SHA256 hash SHA256 Egg 2.7 Mar 14, 2014
django_pony_forms-0.3.6-py27-none-any.whl (7.0 kB) Copy SHA256 hash SHA256 Wheel 2.7 Mar 14, 2014
django_pony_forms-0.3.6.tar.gz (5.6 kB) Copy SHA256 hash SHA256 Source None Mar 14, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page