No project description provided
Project description
Django pony forms
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.11 - 2.2 and Python 2.7, 3.5-3.7.
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 | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Close
Hashes for django_pony_forms-0.7.0-py3.6.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | c68648d89540638803b044f646a9f7dd100f55ff0becb3c99af3ad77618dee61 |
|
MD5 | 80db46593d66b0fb3af3c15bc344b730 |
|
BLAKE2b-256 | f290c64c25b36e63560557b08f883f7064770dfa6cc1a8b9726cd55c50f3f9a2 |
Close
Hashes for django_pony_forms-0.7.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ac773527fb655a6962fa3d6fe029335c330768ccf423a5bfc926d5cdecafc78 |
|
MD5 | a69432f537b525f75cdfde0c8e92c2ea |
|
BLAKE2b-256 | 28b64d9d63b7fd7e21d9aeb7fc515d8e66db600228ef269f9a4b2374c2ea90ce |