From e13a58e808087b032594f96b5c347741c0126ce6 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 24 Mar 2016 00:05:04 -0500 Subject: [PATCH] Add the 'is any' verb to default list for most grid filters --- tailbone/newgrids/filters.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tailbone/newgrids/filters.py b/tailbone/newgrids/filters.py index e5d375a8..413f87a3 100644 --- a/tailbone/newgrids/filters.py +++ b/tailbone/newgrids/filters.py @@ -159,7 +159,7 @@ class GridFilter(object): if callable(verbs): return verbs() return verbs - return ['equal', 'not_equal', 'is_null', 'is_not_null'] + return ['equal', 'not_equal', 'is_null', 'is_not_null', 'is_any'] def set_value_renderer(self, renderer): """ @@ -289,7 +289,7 @@ class AlchemyStringFilter(AlchemyGridFilter): Expose contains / does-not-contain verbs in addition to core. """ return ['contains', 'does_not_contain', - 'equal', 'not_equal', 'is_null', 'is_not_null'] + 'equal', 'not_equal', 'is_null', 'is_not_null', 'is_any'] def filter_contains(self, query, value): """ @@ -366,6 +366,7 @@ class AlchemyDateFilter(AlchemyGridFilter): 'less_equal': "on or before", 'is_null': "is null", 'is_not_null': "is not null", + 'is_any': "is any", } def default_verbs(self): @@ -373,7 +374,7 @@ class AlchemyDateFilter(AlchemyGridFilter): Expose greater-than / less-than verbs in addition to core. """ return ['equal', 'not_equal', 'greater_than', 'greater_equal', - 'less_than', 'less_equal', 'is_null', 'is_not_null'] + 'less_than', 'less_equal', 'is_null', 'is_not_null', 'is_any'] def make_date(self, value): """