Django stars widget
Description
This is a simple widget rendering so-called rating stars as input for an integer field. It is based solely on CSS 3, as laid out by Martin Ivanov.
Usage
Just add the Stars widget to any IntegerField in a Django form.
from django import forms
from django_starfield import Stars
class StarsExampleForm(forms.Form):
rating = forms.IntegerField(widget=Stars)
The following aspects are configurable, both in the Django settings and when creating the widget (by passing an argument to Stars):
Aspect |
Format |
Default |
Setting name |
Argument |
|---|---|---|---|---|
Number of stars |
integer |
5 |
STARFIELD_STARS |
stars |
Character used as star |
hexadecimal codepoint |
2605 |
STARFIELD_CODEPOINT |
codepoint |
Colour of stars |
HTML colour |
#f5b301 |
STARFIELD_COLOUR |
colour |
Please note that some browsers render some Unicode characters, especially emojis, as images, so changing the font colour will not work.
Differences
This is different from other star rating applications in that it provides only a widget returning its selction to any IntegerField. It is not a complete rating application, just a presentational widget for integer input. It is also different in that it depends only on CSS3, without any JavaScript.
Metadata
Release files for django-starfield 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-starfield-1.0.tar.gz | 6.6 kB | Without provenance | Details for django-starfield-1.0.tar.gz |
Release files / django-starfield-1.0.tar.gz
| Download URL | django-starfield-1.0.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
885fcbf5333f5d80b1f5ae2fff57e23b95c4b9d7d7b02f6602dc041c486aeabf
|
|
BLAKE2b-256 checksum How to use checksums |
dcd7a9e170207db06ea255f58d6777969b35a9690440d776b1d4f833b545d8a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.6
|
Security for django-starfield 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.