-
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 the ability to require unique input to custom field #8198
Comments
Maybe this can already be solved with a 'custom validator'? The uniqueness scoping that you seam to have in mind are not easily applied to all other netbox users imo |
As pointed out, this should be solvable with a custom validator. The logic implemented would be the same as we would implement. It would need to be a custom validation class, so perhaps adding a new option to the base custom validation of "unique" might be the best way forward here. |
It can be, although custom validation doesn't currently support uniqueness checking as a standard validator: It would require the introduction of a custom class. (This might be an FR on its own.) I do think there's value in providing optional uniqueness enforcement for custom fields, though, just as we provide min/max and regex validation. Actually enforcing the validation could get tricky, though. I'm going to tag this for milestone assignment as I think it's worth exploring. If it ends up not being feasible, so be it. |
This could be a good candidate for 3.6 |
NetBox version
v3.1.1
Feature type
New functionality
Proposed functionality
Currently, custom fields are never checked for unique content.
It would be nice to be able to add checks for uniqueness inside custom fields as an option to that specific custom field.
Use case
I am using custom fields to add a unique name similar to a Common Language Location Identifiers (CLLI) name for each site.
No two sites should have the same unique name from this field.
Database changes
The database would probably need a new column to track if the custom field needs a uniqueness check, and in the general case, what the scope of the uniqueness check should be (example: global, regional, site, none).
External dependencies
None
The text was updated successfully, but these errors were encountered: