Skip to content

CSV import should accept the "slug" value for choice fields #5003

@jeremystretch

Description

@jeremystretch

Environment

  • Python version: 3.6.9
  • NetBox version: 2.8.9

Proposed Functionality

For fields which specify one of several pre-defined choices, users should be able to specify the "slug" value rather than the proper string. For example, here are the available slug values and corresponding names for a rack's type:

Slug Name
2-post-frame 2-post frame
4-post-frame 4-post frame
4-post-cabinet 4-post cabinet
wall-frame Wall-mounted frame
wall-cabinet Wall-mounted cabinet

It may make sense to use the slug value consistently for both import and export operations, though I'll leave that open for discussion.

Use Case

NetBox v2.7 replaced the old integer-based choice field IDs with human-friendly slugs. These are more convenient to handle when manipulating data, as extra attention is not needed to ensure correct capitalization, spacing, or punctuation. For example, it is quicker and simpler to write wall-frame than Wall-mounted frame, and the later provides no further information than the former within the context of data entry.

Database Changes

None

External Dependencies

None

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the application

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions