Skip to main content

A simple Django form field widget to display a text field with the current word count.

Project description

Countable Field is a simple Django custom for widget for displaying a text area with the current word count displayed underneath. It can be set up to display the count in red when the current word count is out of required minimum or maximum word count for the form field.

Quick start

  1. Add “countable_field” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'countable_field',
    ]
    

2. In the form, set the field’s widget to be “CountableWidget”, passing the minimum and maximum word count as additional parameters, such as:

self.fields['essay_response'].widget = \
            CountableWidget(attrs={'data-min-count': this.essay_min_length,
                                   'data-max-count': this.essay_max_length})

Project details


Download files

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

Files for coa-django-countable-field, version 1.6
Filename, size File type Python version Upload date Hashes
Filename, size coa-django-countable-field-1.6.tar.gz (9.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

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