Add Grid.remove_filter() method

This commit is contained in:
Lance Edgar 2017-12-06 19:54:13 -06:00
parent 908ca52b08
commit 587871e87c

View file

@ -129,10 +129,13 @@ class Grid(object):
def set_filter(self, key, *args, **kwargs): def set_filter(self, key, *args, **kwargs):
if len(args) == 1 and args[0] is None: if len(args) == 1 and args[0] is None:
self.filters.pop(key, None) self.remove_filter(key)
else: else:
self.filters[key] = self.make_filter(key, *args, **kwargs) self.filters[key] = self.make_filter(key, *args, **kwargs)
def remove_filter(self, key):
self.filters.pop(key, None)
def set_label(self, key, label): def set_label(self, key, label):
self.labels[key] = label self.labels[key] = label
if key in self.filters: if key in self.filters: