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

@ -14,7 +14,7 @@ from django.urls import reverse
from dcim.choices import *
from dcim.constants import *
from dcim.svg import RackElevationSVG
from netbox.models import OrganizationalModel, NetBoxModel
from netbox.models import OrganizationalModel, PrimaryModel
from utilities.choices import ColorChoices
from utilities.fields import ColorField, NaturalOrderingField
from utilities.utils import array_to_string, drange
@ -46,7 +46,7 @@ class RackRole(OrganizationalModel):
return reverse('dcim:rackrole', args=[self.pk])
class Rack(NetBoxModel, WeightMixin):
class Rack(PrimaryModel, WeightMixin):
"""
Devices are housed within Racks. Each rack has a defined height measured in rack units, and a front and rear face.
Each Rack is assigned to a Site and (optionally) a Location.
@ -157,9 +157,6 @@ class Rack(NetBoxModel, WeightMixin):
'distance between the front and rear rails.'
)
)
comments = models.TextField(
blank=True
)
# Generic relations
vlan_groups = GenericRelation(
@ -463,7 +460,7 @@ class Rack(NetBoxModel, WeightMixin):
return round(total_weight / 1000, 2)
class RackReservation(NetBoxModel):
class RackReservation(PrimaryModel):
"""
One or more reserved units within a Rack.
"""