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

@@ -2,8 +2,7 @@ from django.contrib.contenttypes.fields import GenericRelation
from django.db import models
from django.urls import reverse
from dcim.fields import ASNField
from netbox.models import NetBoxModel
from netbox.models import PrimaryModel
__all__ = (
'ProviderNetwork',
@@ -11,7 +10,7 @@ __all__ = (
)
class Provider(NetBoxModel):
class Provider(PrimaryModel):
"""
Each Circuit belongs to a Provider. This is usually a telecommunications company or similar organization. This model
stores information pertinent to the user's relationship with the Provider.
@@ -34,9 +33,6 @@ class Provider(NetBoxModel):
blank=True,
verbose_name='Account number'
)
comments = models.TextField(
blank=True
)
# Generic relations
contacts = GenericRelation(
@@ -57,7 +53,7 @@ class Provider(NetBoxModel):
return reverse('circuits:provider', args=[self.pk])
class ProviderNetwork(NetBoxModel):
class ProviderNetwork(PrimaryModel):
"""
This represents a provider network which exists outside of NetBox, the details of which are unknown or
unimportant to the user.
@@ -75,13 +71,6 @@ class ProviderNetwork(NetBoxModel):
blank=True,
verbose_name='Service ID'
)
description = models.CharField(
max_length=200,
blank=True
)
comments = models.TextField(
blank=True
)
class Meta:
ordering = ('provider', 'name')