Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change CustomFieldChoiceSet label separator from comma to colon #14467

Closed
arthanson opened this issue Dec 7, 2023 · 1 comment · Fixed by #14469
Closed

Change CustomFieldChoiceSet label separator from comma to colon #14467

arthanson opened this issue Dec 7, 2023 · 1 comment · Fixed by #14469
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@arthanson
Copy link
Collaborator

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

@arthanson arthanson added the type: feature Introduction of new functionality to the application label Dec 7, 2023
@arthanson arthanson self-assigned this Dec 7, 2023
@arthanson arthanson added the status: accepted This issue has been accepted for implementation label Dec 7, 2023
@jeremystretch
Copy link
Member

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants