Filter rules by tags - exclusion
Closed this issue · 4 comments
silvian-io commented
3c7 commented
To be honest, I have thought about that, too, and didn't come up with a solution, because I had the same issue. Will think about that!
3c7 commented
Haven't found a quick solution. Iterating over the tags after retrieving the rules from the DB is possible, but seems not to be very elegant. But it works...
silvian-io commented
What about this one?
rules = rules.select_from(Tag).join(Rule.tags).filter(~Rule.id.in_(
rules.select_from(Tag).join(Rule.tags).filter(Tag.name.in_(tags)).with_entities(Rule.id)
))
Is not that elegant, but is sql(ish)
3c7 commented
Thanks, good idea!