mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-26 23:27:46 -06:00
#9414: Clean up clone_fields on all models
This commit is contained in:
@@ -263,7 +263,7 @@ class ConsolePort(ModularComponentModel, CabledObjectModel, PathEndpoint):
|
||||
help_text='Port speed in bits per second'
|
||||
)
|
||||
|
||||
clone_fields = ['device', 'type', 'speed']
|
||||
clone_fields = ('device', 'module', 'type', 'speed')
|
||||
|
||||
class Meta:
|
||||
ordering = ('device', '_name')
|
||||
@@ -290,7 +290,7 @@ class ConsoleServerPort(ModularComponentModel, CabledObjectModel, PathEndpoint):
|
||||
help_text='Port speed in bits per second'
|
||||
)
|
||||
|
||||
clone_fields = ['device', 'type', 'speed']
|
||||
clone_fields = ('device', 'module', 'type', 'speed')
|
||||
|
||||
class Meta:
|
||||
ordering = ('device', '_name')
|
||||
@@ -327,7 +327,7 @@ class PowerPort(ModularComponentModel, CabledObjectModel, PathEndpoint):
|
||||
help_text="Allocated power draw (watts)"
|
||||
)
|
||||
|
||||
clone_fields = ['device', 'maximum_draw', 'allocated_draw']
|
||||
clone_fields = ('device', 'module', 'maximum_draw', 'allocated_draw')
|
||||
|
||||
class Meta:
|
||||
ordering = ('device', '_name')
|
||||
@@ -441,7 +441,7 @@ class PowerOutlet(ModularComponentModel, CabledObjectModel, PathEndpoint):
|
||||
help_text="Phase (for three-phase feeds)"
|
||||
)
|
||||
|
||||
clone_fields = ['device', 'type', 'power_port', 'feed_leg']
|
||||
clone_fields = ('device', 'module', 'type', 'power_port', 'feed_leg')
|
||||
|
||||
class Meta:
|
||||
ordering = ('device', '_name')
|
||||
@@ -672,7 +672,10 @@ class Interface(ModularComponentModel, BaseInterface, CabledObjectModel, PathEnd
|
||||
related_query_name='interface',
|
||||
)
|
||||
|
||||
clone_fields = ['device', 'parent', 'bridge', 'lag', 'type', 'mgmt_only', 'poe_mode', 'poe_type']
|
||||
clone_fields = (
|
||||
'device', 'module', 'parent', 'bridge', 'lag', 'type', 'mgmt_only', 'mtu', 'mode', 'speed', 'duplex', 'rf_role',
|
||||
'rf_channel', 'rf_channel_frequency', 'rf_channel_width', 'tx_power', 'poe_mode', 'poe_type', 'vrf',
|
||||
)
|
||||
|
||||
class Meta:
|
||||
ordering = ('device', CollateAsChar('_name'))
|
||||
@@ -890,7 +893,7 @@ class FrontPort(ModularComponentModel, CabledObjectModel):
|
||||
]
|
||||
)
|
||||
|
||||
clone_fields = ['device', 'type']
|
||||
clone_fields = ('device', 'type', 'color')
|
||||
|
||||
class Meta:
|
||||
ordering = ('device', '_name')
|
||||
@@ -937,7 +940,7 @@ class RearPort(ModularComponentModel, CabledObjectModel):
|
||||
MaxValueValidator(REARPORT_POSITIONS_MAX)
|
||||
]
|
||||
)
|
||||
clone_fields = ['device', 'type', 'positions']
|
||||
clone_fields = ('device', 'type', 'color', 'positions')
|
||||
|
||||
class Meta:
|
||||
ordering = ('device', '_name')
|
||||
@@ -972,7 +975,7 @@ class ModuleBay(ComponentModel):
|
||||
help_text='Identifier to reference when renaming installed components'
|
||||
)
|
||||
|
||||
clone_fields = ['device']
|
||||
clone_fields = ('device',)
|
||||
|
||||
class Meta:
|
||||
ordering = ('device', '_name')
|
||||
@@ -994,7 +997,7 @@ class DeviceBay(ComponentModel):
|
||||
null=True
|
||||
)
|
||||
|
||||
clone_fields = ['device']
|
||||
clone_fields = ('device',)
|
||||
|
||||
class Meta:
|
||||
ordering = ('device', '_name')
|
||||
@@ -1131,7 +1134,7 @@ class InventoryItem(MPTTModel, ComponentModel):
|
||||
|
||||
objects = TreeManager()
|
||||
|
||||
clone_fields = ['device', 'parent', 'role', 'manufacturer', 'part_id']
|
||||
clone_fields = ('device', 'parent', 'role', 'manufacturer', 'part_id',)
|
||||
|
||||
class Meta:
|
||||
ordering = ('device__id', 'parent__id', '_name')
|
||||
|
||||
@@ -135,9 +135,9 @@ class DeviceType(NetBoxModel):
|
||||
blank=True
|
||||
)
|
||||
|
||||
clone_fields = [
|
||||
clone_fields = (
|
||||
'manufacturer', 'u_height', 'is_full_depth', 'subdevice_role', 'airflow',
|
||||
]
|
||||
)
|
||||
|
||||
class Meta:
|
||||
ordering = ['manufacturer', 'model']
|
||||
@@ -630,9 +630,10 @@ class Device(NetBoxModel, ConfigContextModel):
|
||||
|
||||
objects = ConfigContextModelQuerySet.as_manager()
|
||||
|
||||
clone_fields = [
|
||||
'device_type', 'device_role', 'tenant', 'platform', 'site', 'location', 'rack', 'status', 'airflow', 'cluster',
|
||||
]
|
||||
clone_fields = (
|
||||
'device_type', 'device_role', 'tenant', 'platform', 'site', 'location', 'rack', 'face', 'status', 'airflow',
|
||||
'cluster', 'virtual_chassis',
|
||||
)
|
||||
|
||||
class Meta:
|
||||
ordering = ('_name', 'pk') # Name may be null
|
||||
|
||||
@@ -126,10 +126,10 @@ class PowerFeed(NetBoxModel, PathEndpoint, CabledObjectModel):
|
||||
blank=True
|
||||
)
|
||||
|
||||
clone_fields = [
|
||||
clone_fields = (
|
||||
'power_panel', 'rack', 'status', 'type', 'mark_connected', 'supply', 'phase', 'voltage', 'amperage',
|
||||
'max_utilization', 'available_power',
|
||||
]
|
||||
'max_utilization',
|
||||
)
|
||||
|
||||
class Meta:
|
||||
ordering = ['power_panel', 'name']
|
||||
|
||||
@@ -183,10 +183,10 @@ class Rack(NetBoxModel):
|
||||
to='extras.ImageAttachment'
|
||||
)
|
||||
|
||||
clone_fields = [
|
||||
clone_fields = (
|
||||
'site', 'location', 'tenant', 'status', 'role', 'type', 'width', 'u_height', 'desc_units', 'outer_width',
|
||||
'outer_depth', 'outer_unit',
|
||||
]
|
||||
)
|
||||
|
||||
class Meta:
|
||||
ordering = ('site', 'location', '_name', 'pk') # (site, location, name) may be non-unique
|
||||
|
||||
@@ -295,10 +295,10 @@ class Site(NetBoxModel):
|
||||
to='extras.ImageAttachment'
|
||||
)
|
||||
|
||||
clone_fields = [
|
||||
'status', 'region', 'group', 'tenant', 'facility', 'time_zone', 'description', 'physical_address',
|
||||
'shipping_address', 'latitude', 'longitude',
|
||||
]
|
||||
clone_fields = (
|
||||
'status', 'region', 'group', 'tenant', 'facility', 'time_zone', 'physical_address', 'shipping_address',
|
||||
'latitude', 'longitude', 'description',
|
||||
)
|
||||
|
||||
class Meta:
|
||||
ordering = ('_name',)
|
||||
@@ -372,7 +372,7 @@ class Location(NestedGroupModel):
|
||||
to='extras.ImageAttachment'
|
||||
)
|
||||
|
||||
clone_fields = ['site', 'parent', 'status', 'tenant', 'description']
|
||||
clone_fields = ('site', 'parent', 'status', 'tenant', 'description')
|
||||
|
||||
class Meta:
|
||||
ordering = ['site', 'name']
|
||||
|
||||
Reference in New Issue
Block a user