Set widget when defining enum for a form2 field

This commit is contained in:
Lance Edgar 2017-11-20 12:38:50 -06:00
parent 1325e507fb
commit f541a94351

View file

@ -332,6 +332,7 @@ class Form(object):
if enum:
self.enums[key] = enum
self.set_type(key, 'enum')
self.set_widget(key, dfwidget.SelectWidget(values=list(enum.items())))
else:
self.enums.pop(key, None)