Skip to content

Help Understanding filter #793

Answered by dbarrosop
davama asked this question in Q&A
Mar 30, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

The filters that are not working are because you are not following your data model. For instance, you write:

devices = nr.filter(model="c6880x")

but there is no model field in your data, you have however device_type["model"] = "c6880x" so what you probably want is something like:

devices = nr.filter(F(device_type__model="c6880x"))

Rest of the fields have similar issues, for instance, I think you want:

devices = nr.filter(F(site__name="usa-ht"))
devices = nr.filter(F(device_type__manufacturer__slug="cisco"))
...

Look at the examples at the bottom here, the ones using nested_data, as that's pretty much what you want.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@dbarrosop
Comment options

@davama
Comment options

Answer selected by davama
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants