From fdc00368727bef516e6694f4cce937b8ae4af044 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Wed, 23 Mar 2022 13:58:35 -0400 Subject: [PATCH] Closes #8846: Enable image attachments for module types --- netbox/dcim/models/devices.py | 5 +++++ netbox/templates/dcim/moduletype.html | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/netbox/dcim/models/devices.py b/netbox/dcim/models/devices.py index 67e58298e..04adfbeb4 100644 --- a/netbox/dcim/models/devices.py +++ b/netbox/dcim/models/devices.py @@ -374,6 +374,11 @@ class ModuleType(NetBoxModel): blank=True ) + # Generic relations + images = GenericRelation( + to='extras.ImageAttachment' + ) + clone_fields = ('manufacturer',) class Meta: diff --git a/netbox/templates/dcim/moduletype.html b/netbox/templates/dcim/moduletype.html index 59d1139be..2c8e77be3 100644 --- a/netbox/templates/dcim/moduletype.html +++ b/netbox/templates/dcim/moduletype.html @@ -29,12 +29,13 @@ + {% include 'inc/panels/custom_fields.html' %} {% plugin_left_page object %}
- {% include 'inc/panels/custom_fields.html' %} {% include 'inc/panels/tags.html' %} {% include 'inc/panels/comments.html' %} + {% include 'inc/panels/image_attachments.html' %} {% plugin_right_page object %}