A Likert field for Django models
Project description
django-likert-field
A Likert field for Django models. Useful for adding ratings star functionality.
Installation
This package depends on Six the Python compatibility toolkit
pip install six
pip install django-likert-field
Basic usage
Use in the same manner as a regular model field:
# models.py from likert_field.models import LikertField class PetShopSurvey(models.Model): i_like_snakes = LikertField() # Renders in add.html # # jQuery star rating widget should be able to grab by 'likert-field' class # <label for="id_i_like_snakes">I like snakes:</label> <input id="id_i_like_snakes" type="text" name="i_like_snakes" class="likert-field" /> # detail.html # # assume 'survey' is context object holding instance # {% load likert_fa_stars %} {{ survey.i_like_snakes|fa_stars4|safe }} # Renders in detail.html # # assuming one-star Likert item score # <i class='fa fa-star likert-star'></i> ... other stars maybe...
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
Close
Hashes for django-likert-field-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a19c1ebadf0d95f662ddd70cb3dbd52e74c745e7f57067c58870e0d5c6c4d77b |
|
MD5 | 46808e8f601e60f27859685df5d92b2d |
|
BLAKE2b-256 | dfe2f1b44e0269a8f64fe0bea09587ab58747ac827210706e79eb900bca11bb1 |