[PR #4564] [MERGED] Closes #3147: Allow dynamic access to related objects during CSV import #12874

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/4564
Author: @jeremystretch
Created: 5/1/2020
Status: Merged
Merged: 5/6/2020
Merged by: @jeremystretch

Base: developHead: 3147-csv-import-fields


📝 Commits (10+)

  • 34a17d4 Enable the specifcation of related objects by arbitrary attribute during CSV import
  • 61ae4be Add tests for CSVDataField
  • 4b8ef6b Removed FlexibleModelChoiceField
  • fa630c0 Overhaul CSV import template
  • 718ff4a Update help_texts for models, import forms
  • 4486957 Clean up comments
  • f9f7c19 Clean up CSV import table
  • d85d963 Remove example choices from CSV import form
  • 839e999 Introduce CSVModelForm for dynamic CSV imports
  • 6077448 Extend tests for CSV import

📊 Changes

17 files changed (+706 additions, -879 deletions)

View changed files

📝 netbox/circuits/forms.py (+10 -25)
📝 netbox/circuits/models.py (+3 -2)
📝 netbox/dcim/forms.py (+230 -410)
📝 netbox/dcim/models/__init__.py (+25 -15)
📝 netbox/dcim/models/device_components.py (+12 -7)
📝 netbox/dcim/tests/test_views.py (+22 -16)
📝 netbox/extras/forms.py (+2 -2)
📝 netbox/ipam/forms.py (+94 -184)
📝 netbox/ipam/models.py (+9 -5)
📝 netbox/secrets/forms.py (+7 -16)
📝 netbox/templates/utilities/obj_bulk_import.html (+86 -49)
📝 netbox/tenancy/forms.py (+9 -22)
📝 netbox/utilities/forms.py (+84 -47)
📝 netbox/utilities/templatetags/helpers.py (+0 -22)
📝 netbox/utilities/tests/test_forms.py (+84 -0)
📝 netbox/utilities/views.py (+8 -6)
📝 netbox/virtualization/forms.py (+21 -51)

📄 Description

Fixes: #3147

Allow the user to specify an arbitrary field on a related object when importing objects in CSV format.


🔄 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/4564 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 5/1/2020 **Status:** ✅ Merged **Merged:** 5/6/2020 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `3147-csv-import-fields` --- ### 📝 Commits (10+) - [`34a17d4`](https://github.com/netbox-community/netbox/commit/34a17d457194d5da5101586d0b965b00897e58ac) Enable the specifcation of related objects by arbitrary attribute during CSV import - [`61ae4be`](https://github.com/netbox-community/netbox/commit/61ae4be16a6ebd0e3741d491ebbbf6baf973eacb) Add tests for CSVDataField - [`4b8ef6b`](https://github.com/netbox-community/netbox/commit/4b8ef6b09a5ba62ca7d5c8195ceb52abc6605ab4) Removed FlexibleModelChoiceField - [`fa630c0`](https://github.com/netbox-community/netbox/commit/fa630c048cd40956f0831b8097f252249a4cf6f8) Overhaul CSV import template - [`718ff4a`](https://github.com/netbox-community/netbox/commit/718ff4a743e3bc88b2c7da6e43c1844d1ee577a9) Update help_texts for models, import forms - [`4486957`](https://github.com/netbox-community/netbox/commit/4486957b9a14099724a8edb1ec954281a708f27b) Clean up comments - [`f9f7c19`](https://github.com/netbox-community/netbox/commit/f9f7c19d810e622d376f544e6c5d1c232e86a1f4) Clean up CSV import table - [`d85d963`](https://github.com/netbox-community/netbox/commit/d85d96384238b4daf7a0a04891597d17c3137665) Remove example choices from CSV import form - [`839e999`](https://github.com/netbox-community/netbox/commit/839e999a7103173a957dc77e7caf1111e3d1bcfe) Introduce CSVModelForm for dynamic CSV imports - [`6077448`](https://github.com/netbox-community/netbox/commit/607744813aa4c8b4e0b9f3915de77efc118cdd48) Extend tests for CSV import ### 📊 Changes **17 files changed** (+706 additions, -879 deletions) <details> <summary>View changed files</summary> 📝 `netbox/circuits/forms.py` (+10 -25) 📝 `netbox/circuits/models.py` (+3 -2) 📝 `netbox/dcim/forms.py` (+230 -410) 📝 `netbox/dcim/models/__init__.py` (+25 -15) 📝 `netbox/dcim/models/device_components.py` (+12 -7) 📝 `netbox/dcim/tests/test_views.py` (+22 -16) 📝 `netbox/extras/forms.py` (+2 -2) 📝 `netbox/ipam/forms.py` (+94 -184) 📝 `netbox/ipam/models.py` (+9 -5) 📝 `netbox/secrets/forms.py` (+7 -16) 📝 `netbox/templates/utilities/obj_bulk_import.html` (+86 -49) 📝 `netbox/tenancy/forms.py` (+9 -22) 📝 `netbox/utilities/forms.py` (+84 -47) 📝 `netbox/utilities/templatetags/helpers.py` (+0 -22) 📝 `netbox/utilities/tests/test_forms.py` (+84 -0) 📝 `netbox/utilities/views.py` (+8 -6) 📝 `netbox/virtualization/forms.py` (+21 -51) </details> ### 📄 Description ### Fixes: #3147 Allow the user to specify an arbitrary field on a related object when importing objects in CSV format. --- <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:24:07 +01:00
adam closed this issue 2025-12-29 22:24:07 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12874