From d56412cd7753d4507c4dbf8d163a705808fd1d24 Mon Sep 17 00:00:00 2001 From: Dominik George <nik@naturalnet.de> Date: Thu, 2 Aug 2018 15:21:42 +0200 Subject: [PATCH] Document configuration. --- README.rst | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 70fad60..a0ac1ca 100644 --- a/README.rst +++ b/README.rst @@ -19,10 +19,23 @@ Just add the Stars widget to any IntegerField in a Django form. from django_starfield import Stars class StarsExampleForm(forms.Form): - rating = forms.IntegerField(widget=Stars()) - -You can change the number of stars by passing the stars argument to the -Stars widget. + 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 ----------- -- GitLab