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

Add concrete through table for m2m fields from device/inventoryitem/virtualmachine to softwareimagefile #5299

Open
9 tasks
gsnider2195 opened this issue Feb 16, 2024 · 0 comments
Labels
type: housekeeping Changes to the application which do not directly impact the end user

Comments

@gsnider2195
Copy link
Contributor

Proposed Changes

Follow-up to #5280

  • Add concrete through table for the software_image_files field from device
  • Make the foreign key to software_image_file protected with on_delete=models.PROTECT
  • Intercept the protected error on softwareimagefile delete and change the protectederror so that it raises on the related model instead of the through table model
    • Cannot delete SoftwareImageFile because it has a protected relation to Device
    • NOT Cannot delete SoftwareImageFile because it has a protected relation to DeviceToSoftwareImageFile
    • Should be able to copy existing logic for DeviceTypeToSoftwareImageFile
  • Expose the through table in the API
  • Add filters for the through table and apply to API view
  • Add API test
  • Add filter test
  • Repeat above for inventoryitem
  • Repeat above for virtualmachine
@gsnider2195 gsnider2195 added type: housekeeping Changes to the application which do not directly impact the end user triage This issue is new and has not been reviewed. labels Feb 16, 2024
@HanlinMiao HanlinMiao removed the triage This issue is new and has not been reviewed. label Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: housekeeping Changes to the application which do not directly impact the end user
Projects
None yet
Development

No branches or pull requests

2 participants