Change width, depth and weight fields from integer to decimal #7407

Closed
opened 2025-12-29 20:23:01 +01:00 by adam · 3 comments
Owner

Originally created by @mmfreitas on GitHub (Dec 21, 2022).

NetBox version

v3.4.1

Feature type

Change to existing functionality

Proposed functionality

Currently max weight and mounting_depth fields in the racks model are integer values, while rack weight is a decimal value.
Values related to width, depth and weight should be decimal to provide an accurate representation of the object.

image

Use case

In our Data Center we have racks which have a mounting depth of 72.2 cm for example. The use case is to record this information accurately.

Database changes

Change of these fields from integer to decimal?

External dependencies

No response

Originally created by @mmfreitas on GitHub (Dec 21, 2022). ### NetBox version v3.4.1 ### Feature type Change to existing functionality ### Proposed functionality Currently max weight and mounting_depth fields in the racks model are integer values, while rack weight is a decimal value. Values related to width, depth and weight should be decimal to provide an accurate representation of the object. ![image](https://user-images.githubusercontent.com/91552302/208964890-55e86e0d-10fe-462d-8535-f1d032e2f978.png) ### Use case In our Data Center we have racks which have a mounting depth of 72.2 cm for example. The use case is to record this information accurately. ### Database changes Change of these fields from integer to decimal? ### External dependencies _No response_
adam added the type: feature label 2025-12-29 20:23:01 +01:00
adam closed this issue 2025-12-29 20:23:02 +01:00
Author
Owner

@danner26 commented on GitHub (Mar 8, 2023):

Just a heads up, weight is a decimal:

weight = models.DecimalField(
        max_digits=8,
        decimal_places=2,
        blank=True,
        null=True
    )
@danner26 commented on GitHub (Mar 8, 2023): Just a heads up, weight is a decimal: ``` weight = models.DecimalField( max_digits=8, decimal_places=2, blank=True, null=True ) ```
Author
Owner

@mmfreitas commented on GitHub (Mar 10, 2023):

Just a heads up, weight is a decimal:

weight = models.DecimalField(
        max_digits=8,
        decimal_places=2,
        blank=True,
        null=True
    )

Yes, sorry. I meant maximum weight as decimal, as you can see in the image above it is not rendered in decimal.

@mmfreitas commented on GitHub (Mar 10, 2023): > Just a heads up, weight is a decimal: > > ``` > weight = models.DecimalField( > max_digits=8, > decimal_places=2, > blank=True, > null=True > ) > ``` Yes, sorry. I meant maximum weight as decimal, as you can see in the image above it is not rendered in decimal.
Author
Owner

@jeremystretch commented on GitHub (May 2, 2023):

In our Data Center we have racks which have a mounting depth of 72.2 cm for example. The use case is to record this information accurately.

A rack's mounting depth is measured in millimeters, so you would enter a value of 722. And there should be no need to ever declare fractional units for a rack's maximum weight (which is itself always a conservative estimate).

@jeremystretch commented on GitHub (May 2, 2023): > In our Data Center we have racks which have a mounting depth of 72.2 cm for example. The use case is to record this information accurately. A rack's mounting depth is measured in millimeters, so you would enter a value of 722. And there should be no need to ever declare fractional units for a rack's maximum weight (which is itself always a conservative estimate).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7407