python ObjectListView negate filter
<p>I need some help with negate this filter for the ObjectListView.</p>

<pre><code>def addFilter(self, text):
    # OLV.Filter.Predicate()
    meter_flt = OLV.Filter.TextSearch(self, text=text)
    self.SetFilter(meter_flt)
</code></pre>

<p>This works great, but if i try to filter like "chicken" then it's only show chickens. I want it to be reversed, so if i type chicken, everything apart from chicken should be displayed.</p>

<p>Thanks for your help!</p>

<p>You can use <a href="http://objectlistview.sourceforge.net/python/features.html#filtering" rel="nofollow"><code>Filter.Predicate</code></a></p>

<blockquote>
  <p>Filter.Predicate(booleanCallable) Show only the model objects for
  which the given callable returns true. The callable must accept a
  single parameter, which is the model object to be considered.</p>
</blockquote>

<p>Following is a code snippet for handling multiple text to be excluded from the list of items.</p>

<pre><code>def __init__(self):
    self.text_list = [] # list of text to be excluded
    self.SetFilter(Filter.Predicate(self.filterMethod))

def addFilter(self, text):
    self.text_list.append(text)
    self.RepopulateList() # so that our filter_method is applied again

def filterMethod(self,obj):
    for text in self.text_list:
        if {YOUR EXCLUSION LOGIC HERE}:
            return False
    return True
</code></pre>

python wxpython filtering objectlistview objectlistview-python