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

Remove extras_features() decorator

This commit is contained in:
jeremystretch
2022-01-19 15:16:10 -05:00
parent c7825e391c
commit cdae0c2bef
26 changed files with 58 additions and 143 deletions

View File

@@ -5,8 +5,8 @@ from django.urls import reverse
from circuits.choices import *
from dcim.models import LinkTermination
from extras.utils import extras_features
from netbox.models import ChangeLoggedModel, OrganizationalModel, PrimaryModel
from netbox.models.features import WebhooksMixin
__all__ = (
'Circuit',
@@ -15,7 +15,6 @@ __all__ = (
)
@extras_features('custom_fields', 'custom_links', 'export_templates', 'tags', 'webhooks')
class CircuitType(OrganizationalModel):
"""
Circuits can be organized by their functional role. For example, a user might wish to define CircuitTypes named
@@ -44,7 +43,6 @@ class CircuitType(OrganizationalModel):
return reverse('circuits:circuittype', args=[self.pk])
@extras_features('custom_fields', 'custom_links', 'export_templates', 'tags', 'webhooks')
class Circuit(PrimaryModel):
"""
A communications circuit connects two points. Each Circuit belongs to a Provider; Providers may have multiple
@@ -138,8 +136,7 @@ class Circuit(PrimaryModel):
return CircuitStatusChoices.colors.get(self.status, 'secondary')
@extras_features('webhooks')
class CircuitTermination(ChangeLoggedModel, LinkTermination):
class CircuitTermination(WebhooksMixin, ChangeLoggedModel, LinkTermination):
circuit = models.ForeignKey(
to='circuits.Circuit',
on_delete=models.CASCADE,

View File

@@ -3,7 +3,6 @@ from django.db import models
from django.urls import reverse
from dcim.fields import ASNField
from extras.utils import extras_features
from netbox.models import PrimaryModel
__all__ = (
@@ -12,7 +11,6 @@ __all__ = (
)
@extras_features('custom_fields', 'custom_links', 'export_templates', 'tags', 'webhooks')
class Provider(PrimaryModel):
"""
Each Circuit belongs to a Provider. This is usually a telecommunications company or similar organization. This model
@@ -72,7 +70,6 @@ class Provider(PrimaryModel):
return reverse('circuits:provider', args=[self.pk])
@extras_features('custom_fields', 'custom_links', 'export_templates', 'tags', 'webhooks')
class ProviderNetwork(PrimaryModel):
"""
This represents a provider network which exists outside of NetBox, the details of which are unknown or