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

Merge branch 'develop' into feature

This commit is contained in:
jeremystretch
2021-08-06 10:06:52 -04:00
8 changed files with 59 additions and 5 deletions

View File

@ -252,6 +252,7 @@ class PowerPortTypeChoices(ChoiceSet):
TYPE_IEC_C14 = 'iec-60320-c14'
TYPE_IEC_C16 = 'iec-60320-c16'
TYPE_IEC_C20 = 'iec-60320-c20'
TYPE_IEC_C22 = 'iec-60320-c22'
# IEC 60309
TYPE_IEC_PNE4H = 'iec-60309-p-n-e-4h'
TYPE_IEC_PNE6H = 'iec-60309-p-n-e-6h'
@ -351,6 +352,7 @@ class PowerPortTypeChoices(ChoiceSet):
(TYPE_IEC_C14, 'C14'),
(TYPE_IEC_C16, 'C16'),
(TYPE_IEC_C20, 'C20'),
(TYPE_IEC_C22, 'C22'),
)),
('IEC 60309', (
(TYPE_IEC_PNE4H, 'P+N+E 4H'),
@ -467,6 +469,7 @@ class PowerOutletTypeChoices(ChoiceSet):
TYPE_IEC_C13 = 'iec-60320-c13'
TYPE_IEC_C15 = 'iec-60320-c15'
TYPE_IEC_C19 = 'iec-60320-c19'
TYPE_IEC_C21 = 'iec-60320-c21'
# IEC 60309
TYPE_IEC_PNE4H = 'iec-60309-p-n-e-4h'
TYPE_IEC_PNE6H = 'iec-60309-p-n-e-6h'
@ -558,6 +561,7 @@ class PowerOutletTypeChoices(ChoiceSet):
(TYPE_IEC_C13, 'C13'),
(TYPE_IEC_C15, 'C15'),
(TYPE_IEC_C19, 'C19'),
(TYPE_IEC_C21, 'C21'),
)),
('IEC 60309', (
(TYPE_IEC_PNE4H, 'P+N+E 4H'),

View File

@ -237,6 +237,8 @@ class ConsolePort(ComponentModel, CableTermination, PathEndpoint):
help_text='Port speed in bits per second'
)
clone_fields = ['device', 'type', 'speed']
class Meta:
ordering = ('device', '_name')
unique_together = ('device', 'name')
@ -267,6 +269,8 @@ class ConsoleServerPort(ComponentModel, CableTermination, PathEndpoint):
help_text='Port speed in bits per second'
)
clone_fields = ['device', 'type', 'speed']
class Meta:
ordering = ('device', '_name')
unique_together = ('device', 'name')
@ -303,6 +307,8 @@ class PowerPort(ComponentModel, CableTermination, PathEndpoint):
help_text="Allocated power draw (watts)"
)
clone_fields = ['device', 'maximum_draw', 'allocated_draw']
class Meta:
ordering = ('device', '_name')
unique_together = ('device', 'name')
@ -399,6 +405,8 @@ class PowerOutlet(ComponentModel, CableTermination, PathEndpoint):
help_text="Phase (for three-phase feeds)"
)
clone_fields = ['device', 'type', 'power_port', 'feed_leg']
class Meta:
ordering = ('device', '_name')
unique_together = ('device', 'name')
@ -525,6 +533,8 @@ class Interface(ComponentModel, BaseInterface, CableTermination, PathEndpoint):
related_query_name='interface'
)
clone_fields = ['device', 'parent', 'lag', 'type', 'mgmt_only']
class Meta:
ordering = ('device', CollateAsChar('_name'))
unique_together = ('device', 'name')
@ -641,6 +651,8 @@ class FrontPort(ComponentModel, CableTermination):
]
)
clone_fields = ['device', 'type']
class Meta:
ordering = ('device', '_name')
unique_together = (
@ -687,6 +699,7 @@ class RearPort(ComponentModel, CableTermination):
MaxValueValidator(REARPORT_POSITIONS_MAX)
]
)
clone_fields = ['device', 'type', 'positions']
class Meta:
ordering = ('device', '_name')
@ -724,6 +737,8 @@ class DeviceBay(ComponentModel):
null=True
)
clone_fields = ['device']
class Meta:
ordering = ('device', '_name')
unique_together = ('device', 'name')
@ -806,6 +821,8 @@ class InventoryItem(MPTTModel, ComponentModel):
objects = TreeManager()
clone_fields = ['device', 'parent', 'manufacturer', 'part_id']
class Meta:
ordering = ('device__id', 'parent__id', '_name')
unique_together = ('device', 'parent', 'name')