Fixes #17954 - Handle CircuitTerminations in Cable Bulk Import #17995
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #17954
Add Support for Bulk Importing Cables Connected to Circuits
This pull request enhances the bulk import functionality for cables by allowing users to specify circuits as termination points on either side of a cable. Previously, only devices could be specified for cable terminations during bulk import which didn't allow for Cables to be connected to Circuit Terminations properly.
Key Changes:
Added Fields for Circuit Terminations:
side_a_circuit
andside_b_circuit
fields in theCableImportForm
withindcim/forms/bulk_import.py
.cid
) as a termination point.Updated CableImportForm Validation Logic:
_clean_side
method inCableImportForm
to handle cases where a circuit is specified instead of a device.Enhanced Bulk Import Template:
bulk_import.html
to display a "Conditional" tag for fields that are conditionally required, improving user experience during the import process.Extended CSV Field Functionality:
CSVModelChoiceField
inutilities/forms/fields/csv.py
to accept aconditional
parameter.Benefits:
Usage Notes: