-
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
Add custom field types for standardized location identifiers #12194
Comments
This would be awesome, especially UN-LOCODE! Do you have some idea in mind how to model this? Like for example would there be two levels for country and city? |
My initial thought here was to introduce new custom field types to hold the types of data mentioned above, but in retrospect that seems like a poor approach that won't scale well. Instead, I've just opened #12988 which proposes moving stored custom field choices into a separate model, which will allow for the efficient reuse of choice sets across multiple custom fields. Marking this as blocked pending the acceptance of that proposal. |
Would it be possible to include NUTS1-3 for regions too? |
* Initial work on custom field choice sets * Rename choices to extra_choices (prep for #12194) * Remove CustomField.choices * Add & update tests * Clean up table columns * Add order_alphanetically boolean for choice sets * Introduce ArrayColumn for choice lists * Show dependent custom fields on choice set view * Update custom fields documentation * Introduce ArrayWidget for more convenient editing of choices * Incorporate PR feedback * Misc cleanup
Another set to consider is CLLI. |
* Initial work on custom field choice sets * Rename choices to extra_choices (prep for #12194) * Remove CustomField.choices * Add & update tests * Clean up table columns * Add order_alphanetically boolean for choice sets * Introduce ArrayColumn for choice lists * Show dependent custom fields on choice set view * Update custom fields documentation * Introduce ArrayWidget for more convenient editing of choices * Incorporate PR feedback * Misc cleanup * Initial work on predefined choices for custom fields * Misc cleanup * Add IATA airport codes * #13241: Add support for custom field choice labels * Restore ArrayColumn * Misc cleanup * Change extra_choices back to a nested ArrayField to preserve choice ordering * Hack to bypass GraphQL API test utility absent support for nested ArrayFields
NetBox version
v3.4.7
Feature type
New functionality
Proposed functionality
Add three new types of custom field:
Custom fields of either type would render as selection fields listing only valid values as selectable options. These would be maintained within NetBox core, with no additional setup needed on the part of the administrator.
Use case
These are well-known values with a wide range of useful applications concerning the assignment of location data. For example, it is common practice to designate the LOCODE for each site on a network.
Database changes
N/A
External dependencies
There are a few ways we might source this data, such as the locode Python package. Further evaluation of the available options is needed.
The text was updated successfully, but these errors were encountered: