Create mixin classes to enable image attachments and contact assignments #8421

Closed
opened 2025-12-29 20:36:31 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Aug 4, 2023).

Originally assigned to: @jeremystretch on GitHub.

Proposed Changes

Create two new mixin classes for models that support image attachments and/or contact assignments:

  • ImageAttachmentsMixin
  • ContactsMixin

Each of these will define a GenericRelation to its relevant model.

Justification

Models can inherit these mixins to obviate the need to define a GenericRelation directly on the class. This helps mitigate human error and makes it easier to determine on what models these features have been enabled.

Originally created by @jeremystretch on GitHub (Aug 4, 2023). Originally assigned to: @jeremystretch on GitHub. ### Proposed Changes Create two new mixin classes for models that support image attachments and/or contact assignments: - `ImageAttachmentsMixin` - `ContactsMixin` Each of these will define a GenericRelation to its relevant model. ### Justification Models can inherit these mixins to obviate the need to define a GenericRelation directly on the class. This helps mitigate human error and makes it easier to determine on what models these features have been enabled.
adam added the status: acceptedtype: housekeeping labels 2025-12-29 20:36:31 +01:00
adam closed this issue 2025-12-29 20:36:31 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8421