kennethreitz/tablib — Issue #51: Strict tag filtering
Author: dnfehren
Created: 2012-02-03 17:41:58+00:00
State: open

This is a great library, thanks so much for all the work so far.

I needed to filter a dataset by multiple criteria at the same time using tags. When appending each row of my data to the set I added tags for a state ('on' or 'off) and a date (ex '2011-11-01'). I found that the filter function, when given multiple tags, will return a row if it has at least one match between the filter parameter and the list of tags for the row (if the intersection of the parameters and the tag list is greater than 0). However I needed a row returned only when it matched all parameters given to the filter. I've added new copies of the has_tag() and filter() functions in core.py that will only return rows where the set of filter parameters all match with tags in a row.

There might be a more appropriate solution for this use case but I thought it might be useful to bring it up.

The code for strict filtering is in my fork of TabLib if there is interest. Apologies if I am going about submitting this the wrong way but it's a first for me.