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
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.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-countable-field-1.3.tar.gz.
File metadata
- Download URL: django-countable-field-1.3.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1bc09e7f898589940a64a6c6d183e8a18b795c85f7555effd0149ad24393f8f
|
|
| MD5 |
39c04556c220694bf9555822ac141038
|
|
| BLAKE2b-256 |
ab53565ccb9da6c8e8e28f1a715b753e68c33735c3fc03fb84c6df0c89cfc7b3
|
File details
Details for the file django_countable_field-1.3-py3-none-any.whl.
File metadata
- Download URL: django_countable_field-1.3-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46ed06572ed3b0927d2172217a4287ad61e1c7a2c5fe13d9b937c2eeb351509c
|
|
| MD5 |
efc21083d3aef0a16d371828bc0dd019
|
|
| BLAKE2b-256 |
d86348d613d5db62f89a1c2dae96a643e4696e38f6eb27c2d8ac421ad367ba7b
|