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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4666c6ac405ddf300fccb9a500d0918b949f38583700f7ca229dc2ffa5fd698c |
|
MD5 | 8a8380e7bb6789f6970d1e411a2cc4de |
|
BLAKE2b-256 | 7b96d6845dbeca31db5db7f07752fc15e30b9b12b7f272ca031dd84dea20d948 |