Closes #19977: Denormalize device relationships on component models #1553

Closed
opened 2026-04-06 03:44:31 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @jeremystretch on 7/30/2025

Closes: #19977

  • Adds _site, _location, and _rack ForeignKeys on all device component models
    • The included database migration automatically populates these new fields for existing objects
  • Introduce the handle_device_site_change() post_save receiver to automatically update child components when a device is modified
  • Update tests
    • Manually populate these fields where necessary when bulk_create() is employed
    • Tweak GraphQLTestCase to ignore private ForeignKey fields when constructing test queries
*Originally created by @jeremystretch on 7/30/2025* ### Closes: #19977 - Adds `_site`, `_location`, and `_rack` ForeignKeys on all device component models - The included database migration automatically populates these new fields for existing objects - Introduce the `handle_device_site_change()` `post_save` receiver to automatically update child components when a device is modified - Update tests - Manually populate these fields where necessary when `bulk_create()` is employed - Tweak GraphQLTestCase to ignore private ForeignKey fields when constructing test queries
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#1553