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

Adds selection custom field labels to UI

This commit is contained in:
sleepinggenius2
2023-10-04 11:52:21 -04:00
committed by Jeremy Stretch
parent 4d13f4d252
commit 285187542d
3 changed files with 14 additions and 1 deletions

View File

@@ -232,6 +232,11 @@ class CustomField(CloningMixin, ExportTemplatesMixin, ChangeLoggedModel):
return self.choice_set.choices
return []
def get_choice_label(self, value):
if not hasattr(self, '_choice_map'):
self._choice_map = dict(self.choices)
return self._choice_map.get(value, value)
def populate_initial_data(self, content_types):
"""
Populate initial custom field data upon either a) the creation of a new CustomField, or