From 587871e87ccffcd9c0e56df8113a67c3d5d4bcc5 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 6 Dec 2017 19:54:13 -0600 Subject: [PATCH] Add `Grid.remove_filter()` method --- tailbone/grids/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tailbone/grids/core.py b/tailbone/grids/core.py index 3cbe274a..64547a5a 100644 --- a/tailbone/grids/core.py +++ b/tailbone/grids/core.py @@ -129,10 +129,13 @@ class Grid(object): def set_filter(self, key, *args, **kwargs): if len(args) == 1 and args[0] is None: - self.filters.pop(key, None) + self.remove_filter(key) else: 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): self.labels[key] = label if key in self.filters: