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

Introduce the Cloud model

This commit is contained in:
Jeremy Stretch
2021-03-18 11:10:48 -04:00
parent 433c48a1a3
commit 6ff8a267e9
17 changed files with 523 additions and 16 deletions

View File

@ -3,7 +3,7 @@ from django_tables2.utils import Accessor
from tenancy.tables import TenantColumn
from utilities.tables import BaseTable, ButtonsColumn, ChoiceFieldColumn, TagColumn, ToggleColumn
from .models import Circuit, CircuitType, Provider
from .models import *
#
@ -29,6 +29,28 @@ class ProviderTable(BaseTable):
default_columns = ('pk', 'name', 'asn', 'account', 'circuit_count')
#
# Clouds
#
class CloudTable(BaseTable):
pk = ToggleColumn()
name = tables.Column(
linkify=True
)
provider = tables.Column(
linkify=True
)
tags = TagColumn(
url_name='circuits:cloud_list'
)
class Meta(BaseTable.Meta):
model = Cloud
fields = ('pk', 'name', 'provider', 'description', 'tags')
default_columns = ('pk', 'name', 'provider', 'description')
#
# Circuit types
#