mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Standardize on get_FOO_color() method for returning ChoiceField colors
This commit is contained in:
@ -247,6 +247,9 @@ class Rack(NetBoxModel):
|
||||
else:
|
||||
return reversed(range(1, self.u_height + 1))
|
||||
|
||||
def get_status_color(self):
|
||||
return RackStatusChoices.colors.get(self.status)
|
||||
|
||||
def get_rack_units(self, user=None, face=DeviceFaceChoices.FACE_FRONT, exclude=None, expand_devices=True):
|
||||
"""
|
||||
Return a list of rack units as dictionaries. Example: {'device': None, 'face': 0, 'id': 48, 'name': 'U48'}
|
||||
|
Reference in New Issue
Block a user