Skip to main content

Quick and simple django templatetags for displaying forms.

Project description

Quick and simple django templatetags for displaying forms.

Installation

  1. pip install django-standard-form

  2. 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' %}

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-standard-form-1.1.0.tar.gz (7.4 kB view details)

Uploaded Source

File details

Details for the file django-standard-form-1.1.0.tar.gz.

File metadata

File hashes

Hashes for django-standard-form-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d5ca885120820d068bf1c3f0c6ea5dc43795f512563a5922c2e8cfd7691836fa
MD5 d8042e5633d543435b5322241adbc40a
BLAKE2b-256 2fa6a4b89512dd47ba279eab1bf6423438edc067429c7d350dbd1f3f300e9cff

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