allow rack type "mounting depth" to be either inches or millimeters #11902

Closed
opened 2025-12-29 21:51:21 +01:00 by adam · 2 comments
Owner

Originally created by @rconkor on GitHub (Dec 7, 2025).

NetBox version

v.4.4.7

Feature type

Change to existing functionality

Proposed functionality

adjust "mounting depth" for rack types to work the same way as "width, height, depth" allowing users to input a value, then select a unit of measurement (inches or millimeters)

Use case

currently, rack type dimensions (height, width, depth) allow for the selection of either millimeters or inches for the measuring unit.

However, when inputting the "mounting depth" the value must be millimeters.

We'd like to see the rack type mounting depth be more consistent and follow the value inputs for the other measurements (height, width, depth, weight)

EDIT: Very rough stab at the changes

from .choices import RackDimensionUnitChoices 

class RackBase(WeightMixin, PrimaryModel):
    # ...

    mounting_depth = models.DecimalField( 
        verbose_name=_('mounting depth'),
        max_digits=7,
        decimal_places=2,
        blank=True,
        null=True,
        help_text=_(
            'Maximum depth of a mounted device. '
            'For four-post racks, this is the distance between the front and rear rails.'
        ),
    )

    mounting_depth_unit = models.CharField(
        verbose_name=_('mounting depth unit'),
        max_length=50,
        choices=RackDimensionUnitChoices,
        blank=True,
        null=True,
    )

Database changes

would need to extend the field to also store the measuring unit, to do the conversion.

External dependencies

none.

Originally created by @rconkor on GitHub (Dec 7, 2025). ### NetBox version v.4.4.7 ### Feature type Change to existing functionality ### Proposed functionality adjust "mounting depth" for rack types to work the same way as "width, height, depth" allowing users to input a value, then select a unit of measurement (inches or millimeters) ### Use case currently, rack type dimensions (height, width, depth) allow for the selection of either millimeters or inches for the measuring unit. However, when inputting the "mounting depth" the value must be millimeters. We'd like to see the rack type mounting depth be more consistent and follow the value inputs for the other measurements (height, width, depth, weight) EDIT: Very rough stab at the changes ``` from .choices import RackDimensionUnitChoices class RackBase(WeightMixin, PrimaryModel): # ... mounting_depth = models.DecimalField( verbose_name=_('mounting depth'), max_digits=7, decimal_places=2, blank=True, null=True, help_text=_( 'Maximum depth of a mounted device. ' 'For four-post racks, this is the distance between the front and rear rails.' ), ) mounting_depth_unit = models.CharField( verbose_name=_('mounting depth unit'), max_length=50, choices=RackDimensionUnitChoices, blank=True, null=True, ) ``` ### Database changes would need to extend the field to also store the measuring unit, to do the conversion. ### External dependencies none.
adam added the type: featurenetbox labels 2025-12-29 21:51:21 +01:00
adam closed this issue 2025-12-29 21:51:22 +01:00
Author
Owner

@arthanson commented on GitHub (Dec 11, 2025):

Like the previous issue #20941 you can use millimeters to specify the mounting depth.

@arthanson commented on GitHub (Dec 11, 2025): Like the previous issue #20941 you can use millimeters to specify the mounting depth.
Author
Owner

@rconkor commented on GitHub (Dec 11, 2025):

@arthanson again, I do not believe you are evaluating the spirit of consistency. NetBox allows for specifying units of measurement on the same page as rack depth.

That's like saying you can specify the rack weight in kilograms, so why allow to specify grams, pounds, or ounces?
Or set the height in millimeters so why allow inches?

I'm asking for NetBox to have more consistency. Literally the boxes above "mounting depth" all allow you to specify a unit of measurement. It doesn't make sense for mounting depth to be hard coded to millimeters.

@rconkor commented on GitHub (Dec 11, 2025): @arthanson again, I do not believe you are evaluating the spirit of consistency. NetBox allows for specifying units of measurement on the same page as rack depth. That's like saying you can specify the rack weight in kilograms, so why allow to specify grams, pounds, or ounces? Or set the height in millimeters so why allow inches? I'm asking for NetBox to have more consistency. Literally the boxes above "mounting depth" all allow you to specify a unit of measurement. It doesn't make sense for mounting depth to be hard coded to millimeters.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11902