-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Region slug searchable #1366
Comments
Just as an aside to this, removing slugs from the data model was discussed earlier this year but doesn't seem to have come to a resolve: To your usage case, I agree that having a way to search within regions, especially for larger organizations, would be useful. As an Albany NY resident I approve of your example ;) |
Thanks for the input @bellwood Well indeed for all that is related to the Regions, I find slug extremely handy but then again that could just be replaced by a more specific field. Eitherways, "slug" or "something more specific" does not change the original feature request of this topic. :) |
@jdecorniquet In what context do you mean? What type of object(s) do you want to search for by region slug? |
Well in the current version I use (v2.0.7), Region is not a searchable object yet that precisely the type I'm looking for here. My use case has the Region's name standing for acronyms of actual cities, and there slug for the full name. Our Site naming convention includes the actual Region's acronym, so the purpose of this feature would be to ease the acronym lookup in order to create a new site. An example would be one looking for Albany, NY's acronym by querying "albany". One would eventually find the result "ALB,albany,NY" (region name,slug,parent_region_name) and then be able to create a Site named "ALB01" for instance. In my company's case, we dumped from NATO a complete list of North American cities (official acronym, full name, state, postal etc) and would like to import it all in our Netbox in order to have all information in one place. I hope this helps. |
Keep in mind that slugs must be unique, so you can't have two regions with the slug "albany." Also, I would suggest swapping the fields. I would define Albany, CA as:
This ensures that the human-friendly name is always displayed for the region. The name is also currently a unique field, although this example has me considering removing that constraint. I think it'd be reasonable to have two regions named "Albany" (but with unique slugs) since regions are arranged hierarchically (e.g. country > state > city). |
Side question related to this topic: I'm also considering the hassle of actually looking through that drop down selection to find the exact Region we need, even though that's a necessary evil to my case I believe. |
I'd also like to see the
A real-world example of that would be:
When fully populated against 500+ regions, the UI for that page is quite large and makes it difficult to find what you're looking for. |
Really looking forward to this addition, thanks Jeremy! |
* Fixes netbox-community#1765: Improved rendering of null options for model choice fields in filter forms * Fixes netbox-community#1802: Typo in ldap.md * Fixes netbox-community#1621: Tweaked LLDP interface name evaluation logic * Fixes netbox-community#1807: Populate VRF from parent when creating a new prefix * Fixes netbox-community#1809: Populate tenant assignment from parent when creating a new prefix * Closes netbox-community#1824: Add virtual machine count to platforms list * Fixes netbox-community#1818: InventoryItem API serializer no longer requires specifying a null value for items with no parent * Evaluate device_id rather than pulling entire device (DB optimization) * added statement and exaple for using ForeignKey ID's in write actions * Closes netbox-community#1828: Added warning about media directory permissions * fixed duplicate api docs example and grammar * Closes netbox-community#1835: Consistent position of previous/next rack buttons * Fixes netbox-community#1845: Correct display of VMs in list with no role assigned * Closes netbox-community#1406: Display tenant description as title text in object tables * Closes netbox-community#1366: Enable searching for regions by name/slug * Cleaned up InventoryItem add/edit/delete links and return URL * Closes netbox-community#1073: Include prefixes/IPs from all VRFs when viewing the children of a container prefix in the global table * Closes netbox-community#144: Implemented list and bulk edit/delete views for InventoryItems * Added report results to the home page * Fixes netbox-community#1850: Fix TypeError when attempting IP address import if only unnamed devices exist * Added warning message about automatically deleting child inventory items * Release v.2.2.9
Issue type: Feature request
Hello, it would be nice to be able to search for a region slug name.
This would come very handy in case one would build a very exhaustive database of countries/provinces/cities in the following parent/child structure:
-parent name (slug)
--child name (slug)
---sub child name (slug)
Example below:
-CA (canada)
--ON (ontario)
---FAL (fort-albany)
-US (usa)
--CA (california)
---ALA (albany)
--NY (new-york)
---ALB (albany)
Having potentially thousands of city per country we could simply search for the word "albany" and see all Region elements matching or containing it. In the example above, we'd have 3 results for showing the region name, the slug and parent if any. An ouput example below as csv format:
FAL,fort-albany,ON
ALA,albany,CA
ALB,albany,NY
Thanks,
The text was updated successfully, but these errors were encountered: