Quick and simple django templatetags for displaying forms.
Installation
pip install django-standard-form
add 'standard_form' to your INSTALLED_APPS
Usage
Most basic example:
{% load standard_form %}
<form action="" method="post" class="frm">
{% csrf_token %}
<fieldset class="frm-horizontal">
{% standard_form form %}
{% standard_submit %}
</fieldset>
</form>
Rendering fields individually:
<form action="" method="post" class="frm">
{% csrf_token %}
<fieldset class="frm-horizontal">
<ol>
<li>{% standard_field form.field_name_one %}</li>
</ol>
</fieldset>
<fieldset class="frm-vertical">
<ol>
<li>{% standard_field form.field_name_two %}</li>
</ol>
{% standard_submit %}
</fieldset>
</form>
Rendering widgets individually:
<form action="" method="post" class="frm">
{% csrf_token %}
<fieldset class="frm-horizontal">
<ol>
<li>
<label for="id_{{ form.field_name_one.name }}">My label or other stuff</label>
<div class="field">{% standard_widget form.field_name_one %}</div>
</li>
<li>
<label class="empty"></label>
<div class="field"><input type="submit" class="btn" value="{% trans 'Go' %}" /></div>
</li>
</ol>
</fieldset>
</form>
All available options:
{% standard_field form.field_name_one 'no_required no_required_helper no_help_text no_error_text' custom_class='input-block' placeholder='This one has all the available options' label='My label' %}
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-standard-form-1.1.1.tar.gz.
File metadata
- Download URL: django-standard-form-1.1.1.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33d338e891ecf47ce2c6c892261ec2d62ae763c6b65a216e04edd9e69ccce3e4
|
|
| MD5 |
e95f6e064080b4aed96f40e2ac871ea1
|
|
| BLAKE2b-256 |
e582cf78f0b7a46a938def87b8d3ed30ca284a4f6f31c3220f74918abe7c6cf9
|