Skip to content
Snippets Groups Projects
Verified Commit d56412cd authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Document configuration.

parent 3b1862ca
No related branches found
No related tags found
No related merge requests found
...@@ -19,10 +19,23 @@ Just add the Stars widget to any IntegerField in a Django form. ...@@ -19,10 +19,23 @@ Just add the Stars widget to any IntegerField in a Django form.
from django_starfield import Stars from django_starfield import Stars
class StarsExampleForm(forms.Form): class StarsExampleForm(forms.Form):
rating = forms.IntegerField(widget=Stars()) rating = forms.IntegerField(widget=Stars)
You can change the number of stars by passing the stars argument to the The following aspects are configurable, both in the Django settings and when
Stars widget. 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 Differences
----------- -----------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment