Filtering with lists

What could be missing here with using the F for filtering? I have tried this every way I read in the documentation, hopefully something simple. I am just trying to match hosts in the inventory that have all the values in a list.

inventory snip…
- adcred
- bmob
- access-layer
- non-ise-switch
- 3500

filter_groups = [“bmob”, “access-layer”]
myfilter = nr.filter(F(tags_all=filter_groups))

The print just returns an empty dict_keys([])

Thank You!

try with simple filter
myfilter = nr.filter(F(tags__contains=“bmob”)) and if it works try AND OR

Please, make sure your message is formatted correctly so it’s easier to read. You can do what’s been suggested using the OR functionality but if you want to use the all method, which should work, you are missing an underscore; F(tags__all=filter_groups).

Thank You!
This way does work if I use:
myfilter = nr.filter(F(tags__contains=filter_groups[0]) & F(tags__contains=filter_groups[1]))

Thank You!
Using the whole list gives a “TypeError: argument of type ‘NoneType’ is not iterable.” I do have the double underscore. I am still trying to see if I can figure this way out, it seems easier than the simple method. Thank you for the response.

This issue for me was having a host in the inventory that did not have anything under the ‘tags’, this was giving the ‘not iterable’ error. Just documenting this in case I or anyone runs into it later! Thanks!