Change CustomFieldChoiceSet label separator from comma to colon #8934

Closed
opened 2025-12-29 20:43:02 +01:00 by adam · 1 comment
Owner

Originally created by @arthanson on GitHub (Dec 7, 2023).

Originally assigned to: @arthanson on GitHub.

NetBox version

v3.6.6

Feature type

Change to existing functionality

Proposed functionality

Change the CustomFieldChoiceSet label separator from a comma to a colon. Right now for CustomFieldChoiceSets the extra_choices uses a comma to separate out the label from the value for input:

        help_text=mark_safe(_(
            'Enter one choice per line. An optional label may be specified for each choice by appending it with a '
            'comma. Example:'
        ) + ' <code>choice1,First Choice</code>')

This FR would change it to be a colon.

Use case

From working on #13983 this allows nested arrays of these label,value in the CSV import, however commas are default separators for both CSV and the ArrayField. The commas are not stored anywhere they are just used to split the string, so changing to a colon should have no adverse effect and would allow not only easier and less confusing input of data for users, but would make the code simpler as well.

Database changes

None

External dependencies

None

Originally created by @arthanson on GitHub (Dec 7, 2023). Originally assigned to: @arthanson on GitHub. ### NetBox version v3.6.6 ### Feature type Change to existing functionality ### Proposed functionality Change the CustomFieldChoiceSet label separator from a comma to a colon. Right now for CustomFieldChoiceSets the extra_choices uses a comma to separate out the label from the value for input: ``` help_text=mark_safe(_( 'Enter one choice per line. An optional label may be specified for each choice by appending it with a ' 'comma. Example:' ) + ' <code>choice1,First Choice</code>') ``` This FR would change it to be a colon. ### Use case From working on #13983 this allows nested arrays of these label,value in the CSV import, however commas are default separators for both CSV and the ArrayField. The commas are not stored anywhere they are just used to split the string, so changing to a colon should have no adverse effect and would allow not only easier and less confusing input of data for users, but would make the code simpler as well. ### Database changes None ### External dependencies None
adam added the status: acceptedtype: feature labels 2025-12-29 20:43:02 +01:00
adam closed this issue 2025-12-29 20:43:02 +01:00
Author
Owner

@jeremystretch commented on GitHub (Dec 8, 2023):

I actually prefer using a colon now that you mention it, as it feels more natural in a key-value mapping.

@jeremystretch commented on GitHub (Dec 8, 2023): I actually prefer using a colon now that you mention it, as it feels more natural in a key-value mapping.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8934