netbox
netbox copied to clipboard
Add tenancy groups to bulk import
NetBox version
v3.7.1
Feature type
Data model extension
Proposed functionality
When you try to bulk import Locations (e.g.) with a tenancy that is not unique, it prompts you an error saying that. But, it is allowed to create multiple Tenancies with the same name (and slug), but it has to be in different groups. So, it would be nice if I can specify the Tenancy group also, because, without that, I can't import it.
Use case
I have a tenancy group with name and slug "X" and "Y" I have a tenancy with name and slug "A" in group "X" I have a tenancy with name and slug "A" in group "Y" I have a tenancy with name and slug "A" in no group
I want to import it, a Location that it is in tenancy "A", which is in group "Y", without any problems
Nowadays, there's no "tenancy group" field option in import and, if you use "A" in Tenancy field, it raises:
Record 1 tenant: "A" is not unique value for this field; multiple objects were found
Database changes
No response
External dependencies
No response
If implemented, this should be done consistently for all models which support tenant assignment, ideally via the use of a mixin class which adds the tenant
and tenant_group
fields to each bulk import form.