Commit eeb211c6 authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Kazuhiko Shiozaki

Widget.py: Allow to set autocomplete also for hidden fields

We may want to set autocomplete 'off' or whatever other value
parent 3f2b98fa
...@@ -170,6 +170,10 @@ class Widget(object): ...@@ -170,6 +170,10 @@ class Widget(object):
except KeyError: except KeyError:
# In case extra is not defined as in DateTimeWidget # In case extra is not defined as in DateTimeWidget
extra = '' extra = ''
try:
autocomplete = field.get_value('autocomplete')
except KeyError:
autocomplete = ''
result = '' result = ''
# We must adapt the rendering to the type of the value # We must adapt the rendering to the type of the value
# in order to get the correct type back # in order to get the correct type back
...@@ -179,12 +183,14 @@ class Widget(object): ...@@ -179,12 +183,14 @@ class Widget(object):
type="hidden", type="hidden",
name="%s:list" % key, name="%s:list" % key,
value=v, value=v,
autocomplete=autocomplete,
extra=extra) extra=extra)
else: else:
result = render_element("input", result = render_element("input",
type="hidden", type="hidden",
name=key, name=key,
value=value, value=value,
autocomplete=autocomplete,
extra=extra) extra=extra)
return result return result
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment