How to Filter Objects by Multi-Object Custom Field in NetBox Efficiently? #16906
Unanswered
Brescou
asked this question in
Help Wanted!
Replies: 1 comment
-
@Brescou This is not a question specific to Netbox. You should check on Django' side. So, as you found, you can filter using the custom field Now, you can use Django Subquery expression. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi NetBox Team,
I'm trying to filter objects using a custom field of type multi-object. Here is the query I am using:
The issue I'm facing is that the custom field my_cf_name returns a list of IDs. If there's a single object, I get a list like [id], and if there are multiple objects, I get a list like [id1, id2, ...]. Make sense it's the id list of the object associated.
Is there a way to filter using this custom field without having to use multiple subqueries? I'm looking for an efficient way to match objects in the multi-object custom field directly.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions