Set widget when defining enum for a form2 field
This commit is contained in:
parent
1325e507fb
commit
f541a94351
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue