[PR #4050] [MERGED] Closes #568: Extend CSV import to support custom fields #12742

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/4050
Author: @jeremystretch
Created: 1/29/2020
Status: Merged
Merged: 1/30/2020
Merged by: @jeremystretch

Base: developHead: 568-customfield-csv-import


📝 Commits (10+)

📊 Changes

11 files changed (+304 additions, -146 deletions)

View changed files

📝 docs/release-notes/version-2.7.md (+4 -0)
📝 netbox/circuits/forms.py (+7 -5)
📝 netbox/dcim/forms.py (+11 -10)
📝 netbox/extras/forms.py (+50 -101)
📝 netbox/extras/models.py (+71 -0)
📝 netbox/extras/tests/test_customfields.py (+113 -2)
📝 netbox/ipam/forms.py (+15 -13)
📝 netbox/secrets/forms.py (+5 -3)
📝 netbox/tenancy/forms.py (+5 -3)
📝 netbox/utilities/views.py (+16 -4)
📝 netbox/virtualization/forms.py (+7 -5)

📄 Description

Closes: #568

This builds on the work @hSaria did in #3885. I've refactored some of the logic for generating form fields for CustomFields (which was long overdue): A form field can now be generated by calling to_form_field() on the CustomField itself.

CustomFieldModelCSVForm has been introduced specifically to handle CSV import, similar to the forms which exist to support custom fields during filtering and bulk editing.

I've also renamed some of the forms to better convey their use, which accounts for a good deal of the changes present in this PR.


🔄 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/4050 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 1/29/2020 **Status:** ✅ Merged **Merged:** 1/30/2020 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `568-customfield-csv-import` --- ### 📝 Commits (10+) - [`f1d5e28`](https://github.com/netbox-community/netbox/commit/f1d5e28f13d3c8f7fe694860004b7b1eb169a717) CSV import/export custom fields - [`37322fc`](https://github.com/netbox-community/netbox/commit/37322fc1006e0f267c592408c2f2445068617cfb) Fixed import choice name - [`de1355e`](https://github.com/netbox-community/netbox/commit/de1355e6bc6c42f10dd135c89478322a924073a4) Changelog #568 - [`d075bf5`](https://github.com/netbox-community/netbox/commit/d075bf58828a73b6b3ce27fd064db3dbe0973b9f) Merge branch 'develop' into 568-csv-import-cf - [`89e6de3`](https://github.com/netbox-community/netbox/commit/89e6de3652173b6fabc265088e171cc457bb0561) Merge branch 'develop' into 568-csv-import-cf - [`a2d5aca`](https://github.com/netbox-community/netbox/commit/a2d5aca1d9a9a3ff717c0eacda279464a6a9d7ea) Moved changelog to v2.7 - [`9f68f8d`](https://github.com/netbox-community/netbox/commit/9f68f8d1a615b210a8c33c76a68802a6c6bec1ea) Update component CSV forms - [`c0a3285`](https://github.com/netbox-community/netbox/commit/c0a3285b8b5fee5f2197d707673b5dcc61463044) Merge branch 'develop' into 568-csv-import-cf - [`b11224a`](https://github.com/netbox-community/netbox/commit/b11224a8b46fd0943aac519e116f02862e2bf0b6) Merge branch 'develop' into 568-csv-import-cf - [`bdfead6`](https://github.com/netbox-community/netbox/commit/bdfead6265bb97f308978312ef42538508eab9bb) Merge branch 'develop' into 568-csv-import-cf ### 📊 Changes **11 files changed** (+304 additions, -146 deletions) <details> <summary>View changed files</summary> 📝 `docs/release-notes/version-2.7.md` (+4 -0) 📝 `netbox/circuits/forms.py` (+7 -5) 📝 `netbox/dcim/forms.py` (+11 -10) 📝 `netbox/extras/forms.py` (+50 -101) 📝 `netbox/extras/models.py` (+71 -0) 📝 `netbox/extras/tests/test_customfields.py` (+113 -2) 📝 `netbox/ipam/forms.py` (+15 -13) 📝 `netbox/secrets/forms.py` (+5 -3) 📝 `netbox/tenancy/forms.py` (+5 -3) 📝 `netbox/utilities/views.py` (+16 -4) 📝 `netbox/virtualization/forms.py` (+7 -5) </details> ### 📄 Description ### Closes: #568 This builds on the work @hSaria did in #3885. I've refactored some of the logic for generating form fields for CustomFields (which was long overdue): A form field can now be generated by calling `to_form_field()` on the CustomField itself. `CustomFieldModelCSVForm` has been introduced specifically to handle CSV import, similar to the forms which exist to support custom fields during filtering and bulk editing. I've also renamed some of the forms to better convey their use, which accounts for a good deal of the changes present in this PR. --- <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:23:23 +01:00
adam closed this issue 2025-12-29 22:23:23 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12742