Allow passing None to Form.set_renderer()
i.e. to remove any renderer which has been set
This commit is contained in:
parent
f021df446c
commit
dfd43b55aa
|
@ -576,7 +576,11 @@ class Form(object):
|
||||||
self.enums.pop(key, None)
|
self.enums.pop(key, None)
|
||||||
|
|
||||||
def set_renderer(self, key, renderer):
|
def set_renderer(self, key, renderer):
|
||||||
self.renderers[key] = renderer
|
if renderer is None:
|
||||||
|
if key in self.renderers:
|
||||||
|
del self.renderers[key]
|
||||||
|
else:
|
||||||
|
self.renderers[key] = renderer
|
||||||
|
|
||||||
def set_widget(self, key, widget):
|
def set_widget(self, key, widget):
|
||||||
self.widgets[key] = widget
|
self.widgets[key] = widget
|
||||||
|
|
Loading…
Reference in a new issue