Browse Source

Closes #8846: Enable image attachments for module types

jeremystretch 3 năm trước cách đây
mục cha
commit
fdc0036872

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

@@ -374,6 +374,11 @@ class ModuleType(NetBoxModel):
         blank=True
         blank=True
     )
     )
 
 
+    # Generic relations
+    images = GenericRelation(
+        to='extras.ImageAttachment'
+    )
+
     clone_fields = ('manufacturer',)
     clone_fields = ('manufacturer',)
 
 
     class Meta:
     class Meta:

+ 2 - 1
netbox/templates/dcim/moduletype.html

@@ -29,12 +29,13 @@
           </table>
           </table>
         </div>
         </div>
       </div>
       </div>
+      {% include 'inc/panels/custom_fields.html' %}
       {% plugin_left_page object %}
       {% plugin_left_page object %}
     </div>
     </div>
     <div class="col col-md-6">
     <div class="col col-md-6">
-      {% include 'inc/panels/custom_fields.html' %}
       {% include 'inc/panels/tags.html' %}
       {% include 'inc/panels/tags.html' %}
       {% include 'inc/panels/comments.html' %}
       {% include 'inc/panels/comments.html' %}
+      {% include 'inc/panels/image_attachments.html' %}
       {% plugin_right_page object %}
       {% plugin_right_page object %}
     </div>
     </div>
   </div>
   </div>