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:
@@ -169,3 +169,9 @@ class PowerFeed(NetBoxModel, PathEndpoint, LinkTermination):
|
||||
@property
|
||||
def parent_object(self):
|
||||
return self.power_panel
|
||||
|
||||
def get_type_color(self):
|
||||
return PowerFeedTypeChoices.colors.get(self.type)
|
||||
|
||||
def get_status_color(self):
|
||||
return PowerFeedStatusChoices.colors.get(self.status)
|
||||
|
||||
Reference in New Issue
Block a user