Allow non unique location name within a site with different parent locations #5416

Closed
opened 2025-12-29 19:27:44 +01:00 by adam · 2 comments
Owner

Originally created by @kovalev94 on GitHub (Sep 23, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v2.11.12

Feature type

Change to existing functionality

Proposed functionality

Allow non unique locations within a site with different parent location.
Uniqueness restriction should be limited to the items with one parent.

Use case

Some data models require non unique location name within a site when nesting. Here is example from my company data model.

SomeSite->Entrance 3->Tech.floor
                ->Entrance 5->Tech.floor
                                       ->Basement
                 ->Entrance 7->Tech. floor
In our data model, site-usually an apartment house with several entrances. In some of this entrances we have wall-mounted cabinets on a tech-floor and sometimes in a basement.
This example show real form of hierarchy, and replicates the real world. You you can't have two same locations within one parent location or site, while you can have locations with the same name, if they are in different places (despite they are at one site), and they wouldn't be the same.
Current restrictions on uniqueness limit hierarchy model.
Removing this restriction will enforce usablity and data modeling will closer to real world.

Database changes

I think this feature do not require database changes

External dependencies

There will no external dependencies

Originally created by @kovalev94 on GitHub (Sep 23, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v2.11.12 ### Feature type Change to existing functionality ### Proposed functionality Allow non unique locations within a site with different parent location. Uniqueness restriction should be limited to the items with one parent. ### Use case Some data models require non unique location name within a site when nesting. Here is example from my company data model. SomeSite->Entrance 3->Tech.floor                 ->Entrance 5->Tech.floor                                        ->Basement                  ->Entrance 7->Tech. floor In our data model, site-usually an apartment house with several entrances. In some of this entrances we have wall-mounted cabinets on a tech-floor and sometimes in a basement. This example show real form of hierarchy, and replicates the real world. You you can't have two same locations within one parent location or site, while you can have locations with the same name, if they are in different places (despite they are at one site), and they wouldn't be the same. Current restrictions on uniqueness limit hierarchy model. Removing this restriction will enforce usablity and data modeling will closer to real world. ### Database changes I think this feature do not require database changes ### External dependencies There will no external dependencies
adam added the status: acceptedtype: feature labels 2025-12-29 19:27:44 +01:00
adam closed this issue 2025-12-29 19:27:44 +01:00
Author
Owner

@Kani999 commented on GitHub (Oct 11, 2021):

There's a similar problem with Regions too. I have opened discuss which describes the problem.

Proposed functionality

  • relax constraint so that the name of a region must be unique only within its assigned parent (if any).
@Kani999 commented on GitHub (Oct 11, 2021): There's a similar problem with `Regions` too. I have opened [discuss](https://github.com/netbox-community/netbox/discussions/7483) which describes the problem. ### Proposed functionality - relax constraint so that the name of a region must be unique only within its assigned parent (if any).
Author
Owner

@jeremystretch commented on GitHub (Oct 19, 2021):

To summarize the proposed changes:

  • Location: Change the unique set from (site, name) to (site, parent, name)
  • Region and SiteGroup: Remove uniqueness constraints on name; enforce (parent, name) as a unique set
@jeremystretch commented on GitHub (Oct 19, 2021): To summarize the proposed changes: * Location: Change the unique set from `(site, name)` to `(site, parent, name)` * Region and SiteGroup: Remove uniqueness constraints on `name`; enforce `(parent, name)` as a unique set
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5416