diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index 277a37692..5f479b126 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -5,6 +5,7 @@ ### Enhancements * [#6423](https://github.com/netbox-community/netbox/issues/6423) - Cache rendered REST API specifications +* [#6708](https://github.com/netbox-community/netbox/issues/6708) - Add image attachment support for circuits, power panels * [#7387](https://github.com/netbox-community/netbox/issues/7387) - Enable arbitrary ordering of custom scripts ### Bug Fixes diff --git a/netbox/circuits/models.py b/netbox/circuits/models.py index 39f38d0b0..bc7dcc219 100644 --- a/netbox/circuits/models.py +++ b/netbox/circuits/models.py @@ -1,3 +1,4 @@ +from django.contrib.contenttypes.fields import GenericRelation from django.core.exceptions import ValidationError from django.db import models from django.urls import reverse @@ -202,6 +203,9 @@ class Circuit(PrimaryModel): comments = models.TextField( blank=True ) + images = GenericRelation( + to='extras.ImageAttachment' + ) # Cache associated CircuitTerminations termination_a = models.ForeignKey( diff --git a/netbox/dcim/models/power.py b/netbox/dcim/models/power.py index f81abd328..0e9520b36 100644 --- a/netbox/dcim/models/power.py +++ b/netbox/dcim/models/power.py @@ -1,3 +1,4 @@ +from django.contrib.contenttypes.fields import GenericRelation from django.core.exceptions import ValidationError from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models @@ -39,6 +40,9 @@ class PowerPanel(PrimaryModel): name = models.CharField( max_length=100 ) + images = GenericRelation( + to='extras.ImageAttachment' + ) objects = RestrictedQuerySet.as_manager() diff --git a/netbox/templates/circuits/circuit.html b/netbox/templates/circuits/circuit.html index e68465c82..b863a8a0e 100644 --- a/netbox/templates/circuits/circuit.html +++ b/netbox/templates/circuits/circuit.html @@ -72,6 +72,7 @@