Small js refactoring
[auf_rh_dae.git] / project / dae / widgets.py
CommitLineData
4718c21c
BS
1from django.utils.safestring import mark_safe
2from django.forms.widgets import Select
3
4
5class ReadOnlyChoiceWidget(Select):
6 def render(self, name, value, attrs=None, choices=()):
7 return mark_safe(
8 '<span>%(display)s</span><input type="hidden" '
9 'name="%(name)s" value="%(value)s" />' % {
10 'display': dict(self.choices)[value],
11 'name': name,
12 'value': value,
13 })