diff --git a/django_starfield/templates/django_starfield/stars.html b/django_starfield/templates/django_starfield/stars.html index 2e8569cfe83ac86b816901774651edd0567f7488..909ef2774be597115fb393affa3e07d4dcbc9757 100644 --- a/django_starfield/templates/django_starfield/stars.html +++ b/django_starfield/templates/django_starfield/stars.html @@ -1,5 +1,6 @@ {% for i in stars %}<!-- --><input type="radio" name="{{ name }}" id="{{ name }}-{{ forloop.counter0 }}" value="{{ i }}" {% if value == i %}checked="checked"{% endif %} /><!-- - --><label for="{{ name }}-{{ forloop.counter0 }}">{{ i }}</label><!-- + --><label for="{{ name }}-{{ forloop.counter0 }}" + style="content: '\{{ codepoint }}'">{{ i }}</label><!-- -->{% endfor %} diff --git a/django_starfield/widgets.py b/django_starfield/widgets.py index 650370e6f32c54899a58341b9ec9bfe372315bd9..ba26e58fffbc2287f32cb310f2b123709794e1a7 100644 --- a/django_starfield/widgets.py +++ b/django_starfield/widgets.py @@ -6,7 +6,7 @@ class Stars(Widget): def __init__(self, attrs=None, stars=5, codepoint='2605'): super(Stars, self).__init__(attrs) self.stars = 5 - self.codepoint = '2605' + self.codepoint = codepoint def get_context(self, name, value, attrs): context = super(Stars, self).get_context(name, value, attrs)