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

Fix widget context access.

parent a3e87f5f
No related branches found
No related tags found
No related merge requests found
{% load static %}
<div class="django-starfield">
{% 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 }}"
--><input type="radio" name="{{ widget.name }}" id="{{ widget.name }}-{{ forloop.counter0 }}"
value="{{ i }}" {% if widget.value == i %}checked="checked"{% endif %} /><!--
--><label for="{{ widget.name }}-{{ forloop.counter0 }}"
style="content: '\{{ codepoint }}'">{{ i }}</label><!--
-->{% endfor %}
</div>
......
......@@ -11,4 +11,5 @@ class Stars(Widget):
def get_context(self, name, value, attrs):
context = super(Stars, self).get_context(name, value, attrs)
context['stars'] = range(self.stars, 0, -1)
context['codepoint'] = self.codepoint
return context
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