Add a management command to manually recalculate naturalized values (see #3799) #3317

Closed
opened 2025-12-29 18:27:39 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Feb 12, 2020).

Originally assigned to: @jeremystretch on GitHub.

Environment

  • Python version: 3.6.9
  • NetBox version: 2.7.4

Proposed Functionality

#3799 implemented "naturalized" ordering fields for certain models. These fields are populated by calling a naturalize() function on their target fields (e.g. name) to produce a string value suitable for alphanumeric sorting. This FR proposes the addition of a management command that will enable a user to recalculate naturalized values on-demand.

python manage.py renaturalize [app_label[.ModelName] [app_label[.ModelName] ...]]

Use Case

Although in theory this command should never be needed, it would be convenient to have on hand in situations where a bug or data import failure result in partially or erroneously normalized values.

Database Changes

None

External Dependencies

None

Originally created by @jeremystretch on GitHub (Feb 12, 2020). Originally assigned to: @jeremystretch on GitHub. ### Environment * Python version: 3.6.9 * NetBox version: 2.7.4 ### Proposed Functionality #3799 implemented "naturalized" ordering fields for certain models. These fields are populated by calling a `naturalize()` function on their target fields (e.g. `name`) to produce a string value suitable for alphanumeric sorting. This FR proposes the addition of a management command that will enable a user to recalculate naturalized values on-demand. ``` python manage.py renaturalize [app_label[.ModelName] [app_label[.ModelName] ...]] ``` ### Use Case Although in theory this command should never be needed, it would be convenient to have on hand in situations where a bug or data import failure result in partially or erroneously normalized values. ### Database Changes None ### External Dependencies None
adam added the status: acceptedtype: feature labels 2025-12-29 18:27:39 +01:00
adam closed this issue 2025-12-29 18:27:39 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3317