Standardize on get_FOO_color() method for returning ChoiceField colors

This commit is contained in:
jeremystretch
2022-02-11 14:25:13 -05:00
parent 9cf9f1bdba
commit 1319b62acb
31 changed files with 81 additions and 60 deletions

View File

@@ -1001,6 +1001,9 @@ class Device(NetBoxModel, ConfigContextModel):
"""
return Device.objects.filter(parent_bay__device=self.pk)
def get_status_color(self):
return DeviceStatusChoices.colors.get(self.status)
class Module(NetBoxModel, ConfigContextModel):
"""