1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #10545: Standardize description & comment fields on primary models (#10834)

* Standardize description & comments fields on primary models

* Update REST API serializers

* Update forms

* Update tables

* Update templates
This commit is contained in:
Jeremy Stretch
2022-11-04 08:28:09 -04:00
committed by GitHub
parent e2f5ee661a
commit bc6b5bc4be
105 changed files with 1014 additions and 534 deletions

View File

@@ -6,7 +6,7 @@ from django.urls import reverse
from ipam.choices import *
from ipam.constants import *
from netbox.models import NetBoxModel
from netbox.models import PrimaryModel
from utilities.utils import array_to_string
@@ -30,10 +30,6 @@ class ServiceBase(models.Model):
),
verbose_name='Port numbers'
)
description = models.CharField(
max_length=200,
blank=True
)
class Meta:
abstract = True
@@ -46,7 +42,7 @@ class ServiceBase(models.Model):
return array_to_string(self.ports)
class ServiceTemplate(ServiceBase, NetBoxModel):
class ServiceTemplate(ServiceBase, PrimaryModel):
"""
A template for a Service to be applied to a device or virtual machine.
"""
@@ -62,7 +58,7 @@ class ServiceTemplate(ServiceBase, NetBoxModel):
return reverse('ipam:servicetemplate', args=[self.pk])
class Service(ServiceBase, NetBoxModel):
class Service(ServiceBase, PrimaryModel):
"""
A Service represents a layer-four service (e.g. HTTP or SSH) running on a Device or VirtualMachine. A Service may
optionally be tied to one or more specific IPAddresses belonging to its parent.