[PR #2949] [CLOSED] CSV Import & Export Custom Fields #12470

Closed
opened 2025-12-29 22:21:46 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/2949
Author: @anthonyeden
Created: 3/1/2019
Status: Closed

Base: developHead: dev_csvcustomfields


📝 Commits (5)

  • 9cb6b79 Changes needed to implement Custom Field imports via CSV, and enable this when importing devices
  • 585f61d Add Custom Fields to the CSV export template
  • c60cbd5 Merge in change to netbox/extras/forms.py from main 'develop' branch.
  • 401370b Merge branch 'develop' into dev_csvcustomfields
  • bcb4cc6 Allow importing custom fields on all other CSV importer models

📊 Changes

10 files changed (+73 additions, -35 deletions)

View changed files

📝 netbox/circuits/forms.py (+3 -3)
📝 netbox/dcim/forms.py (+12 -12)
📝 netbox/extras/forms.py (+2 -2)
📝 netbox/ipam/forms.py (+8 -8)
📝 netbox/secrets/forms.py (+2 -2)
📝 netbox/tenancy/forms.py (+2 -2)
📝 netbox/utilities/forms.py (+20 -0)
📝 netbox/utilities/templatetags/helpers.py (+3 -0)
📝 netbox/utilities/views.py (+17 -2)
📝 netbox/virtualization/forms.py (+4 -4)

📄 Description

Fixes: #568

This pull request is my first attempt at resolving ticket #568.

With these changes, you can now import Custom Fields to Devices. The UI has been updated, and a new version of CSVChoiceField has been created to map the select-field labels to the DB values when performing an import.

It also adds custom fields to the CSV Exporter, using the same column headings as the importer.

If these changes are correct, we need to enable Custom Field importing for all other models by replacing 'forms.ModelForm' with 'CustomFieldForm' in the inheritance of the remainder of the CSVForm models.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/2949 **Author:** [@anthonyeden](https://github.com/anthonyeden) **Created:** 3/1/2019 **Status:** ❌ Closed **Base:** `develop` ← **Head:** `dev_csvcustomfields` --- ### 📝 Commits (5) - [`9cb6b79`](https://github.com/netbox-community/netbox/commit/9cb6b792bacb030848c01e36dcc9142ddf92033e) Changes needed to implement Custom Field imports via CSV, and enable this when importing devices - [`585f61d`](https://github.com/netbox-community/netbox/commit/585f61d38c787c4db89d1bd1411e8e5c89548b36) Add Custom Fields to the CSV export template - [`c60cbd5`](https://github.com/netbox-community/netbox/commit/c60cbd53faa4052103a203b1a945d784f018158e) Merge in change to netbox/extras/forms.py from main 'develop' branch. - [`401370b`](https://github.com/netbox-community/netbox/commit/401370b1270c5885be5924ff58050705cecf364d) Merge branch 'develop' into dev_csvcustomfields - [`bcb4cc6`](https://github.com/netbox-community/netbox/commit/bcb4cc6efd63701d285d5919de479c748bc5cc91) Allow importing custom fields on all other CSV importer models ### 📊 Changes **10 files changed** (+73 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `netbox/circuits/forms.py` (+3 -3) 📝 `netbox/dcim/forms.py` (+12 -12) 📝 `netbox/extras/forms.py` (+2 -2) 📝 `netbox/ipam/forms.py` (+8 -8) 📝 `netbox/secrets/forms.py` (+2 -2) 📝 `netbox/tenancy/forms.py` (+2 -2) 📝 `netbox/utilities/forms.py` (+20 -0) 📝 `netbox/utilities/templatetags/helpers.py` (+3 -0) 📝 `netbox/utilities/views.py` (+17 -2) 📝 `netbox/virtualization/forms.py` (+4 -4) </details> ### 📄 Description ### Fixes: #568 This pull request is my first attempt at resolving ticket #568. With these changes, you can now import Custom Fields to Devices. The UI has been updated, and a new version of CSVChoiceField has been created to map the select-field labels to the DB values when performing an import. It also adds custom fields to the CSV Exporter, using the same column headings as the importer. If these changes are correct, we need to enable Custom Field importing for all other models by replacing 'forms.ModelForm' with 'CustomFieldForm' in the inheritance of the remainder of the CSVForm models. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:21:46 +01:00
adam closed this issue 2025-12-29 22:21:46 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12470