076123c1287ebe71997a5a85154f8fc2de9acee7
[auf_rh_dae.git] / project / dae / widgets.py
1 from django.utils.safestring import mark_safe
2 from django.forms.widgets import Select
3
4
5 class 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 })