Allow passing None to Grid.set_joiner()

doing so will remove the joiner
This commit is contained in:
Lance Edgar 2017-10-18 12:54:57 -07:00
parent f8e98a5817
commit 14f67746bf

View file

@ -115,7 +115,10 @@ class Grid(object):
self.columns.remove(key) self.columns.remove(key)
def set_joiner(self, key, joiner): def set_joiner(self, key, joiner):
self.joiners[key] = joiner if joiner is None:
self.joiners.pop(key, None)
else:
self.joiners[key] = joiner
def set_sorter(self, key, *args, **kwargs): def set_sorter(self, key, *args, **kwargs):
self.sorters[key] = self.make_sorter(*args, **kwargs) self.sorters[key] = self.make_sorter(*args, **kwargs)