2
0
Эх сурвалжийг харах

Closes #10414: Enable general purpose image attachments for device types

jeremystretch 2 жил өмнө
parent
commit
6820796c10

+ 1 - 0
docs/release-notes/version-3.4.md

@@ -4,6 +4,7 @@
 
 ### Enhancements
 
+* [#10414](https://github.com/netbox-community/netbox/issues/10414) - Enable general purpose image attachments for device types
 * [#10600](https://github.com/netbox-community/netbox/issues/10600) - Allow custom object fields to reference a user or group
 * [#11015](https://github.com/netbox-community/netbox/issues/11015) - Remove unit from commit rate column header in circuits table
 * [#11431](https://github.com/netbox-community/netbox/issues/11431) - Disallow changing custom field type after creation

+ 4 - 0
netbox/dcim/models/devices.py

@@ -120,6 +120,10 @@ class DeviceType(PrimaryModel, WeightMixin):
         blank=True
     )
 
+    images = GenericRelation(
+        to='extras.ImageAttachment'
+    )
+
     clone_fields = (
         'manufacturer', 'u_height', 'is_full_depth', 'subdevice_role', 'airflow', 'weight', 'weight_unit'
     )

+ 1 - 0
netbox/templates/dcim/devicetype.html

@@ -98,6 +98,7 @@
             {% 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 %}
         </div>
     </div>