-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Fixes #11685 - Include containing prefixes and aggregates when searching for IP addresses #11686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #11685 - Include containing prefixes and aggregates when searching for IP addresses #11686
Conversation
|
Forgot to mention, for this to function for existing objects the user needs to run the reindex mangement command. |
|
Great work @kkthxbye-code, thank you!
In such cases where a generated migration doesn't actually effect a material schema change, I like to just alter the field's definition in the most recent relevant migration. (Happy to handle this myself.)
Any thoughts on how to best handle this? Should we add |
jeremystretch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work!
My only worry about doing it in the upgrade script, is that the reindexing can take a while. Maybe we can conditionally run it if there has been applied any migration earlier in the script? Edit: Thinking about it for 2 more seconds, this PR technically generates no migrations (if we remove it like you suggested), so maybe that's not a good way to handle it. Thanks for the rest of the feedback, I'll address them shortly! |
|
I addressed the feedback @jeremystretch. Only outstanding issue is how to make the user reindex. I see the following options:
|
|
What if we delete the cache in a new migration, and update |
That's a great idea, do you want to implement it or should I add it to the PR? We might need to check up on how netbox docker is doing things, I think it might need to be updated as well to support reindexing when no cached values exist. |
I'll handle it under #11787; let's leave this as-is. |

Fixes: #11685
inetandcidr.cidrare queried to check if they contain the IP being searched for.There's some screenshots here: #11665 (comment)
There's still time to evaluate if we want to do something special about searching for
inettype fields (IPAddresses), which we can handle in this PR or later.