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

Custom field multiple selection #5451

Closed
TomGrozev opened this issue Dec 13, 2020 · 5 comments
Closed

Custom field multiple selection #5451

TomGrozev opened this issue Dec 13, 2020 · 5 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Milestone

Comments

@TomGrozev
Copy link
Contributor

Environment

  • Python version: 3.8.6
  • NetBox version: 2.10

Proposed Functionality

The ability to be able to select multiple values in custom fields of type "Selection". This is similar to how tags work but the ability to do it for custom selection fields. A new option to allow multiple options to be selected for custom selection fields would be added and using the Django multiple selection form, this can be added.

Use Case

We use ansible to deploy configurations and NetBox as the source of truth. We need to be able to select multiple applications for a virtual machine and then ansible can use that to deploy the application. In order to do this and install multiple applications, we need to be able to select multiple values from a custom field of type "Selection".

Database Changes

A new multiple selection field would be added to the custom field model. Since the changes in version 2.10
store custom field data as JSON, storing a list of values is simple.

External Dependencies

None

@jeremystretch
Copy link
Member

With the move to JSON-based custom field data in v2.10, this is now a possibility.

@jeremystretch jeremystretch added needs milestone Awaiting prioritization for inclusion with a future NetBox release type: feature Introduction of new functionality to the application labels Dec 14, 2020
@hyudra
Copy link

hyudra commented Dec 21, 2020

Is it possible to add custom field with JSON / List type? Sometimes our data do not have fixed length data (such as VM with multiple disks).

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation API change and removed needs milestone Awaiting prioritization for inclusion with a future NetBox release labels Dec 21, 2020
@jeremystretch jeremystretch added this to the v2.11 milestone Dec 21, 2020
@TomGrozev
Copy link
Contributor Author

@hyudra In order for multiple fields to be selected, the natural solution is for the items to be stored as a list in JSON.

@schmitmd
Copy link

schmitmd commented Feb 15, 2021

I've got the same use case as TomGrozev. Using Netbox as a dynamic Ansible inventory via the Netbox Ansible collection. It looks like #5440 / #5459 were closed as rejected though. Is someone going to re-implement this functionality differently for the 2.11 milestone or are those PRs actually valid & intended to be pulled in, or...?

@fabi125
Copy link
Contributor

fabi125 commented Feb 18, 2021

Is it possible to add custom field with JSON / List type? Sometimes our data do not have fixed length data (such as VM with multiple disks).

Having a custom field that can store multiple values (not necessarily from a selection) would be great. Can this FR be expanded to include that or should I open a separate issue?

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.

5 participants