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

Implemented Cable API endpoint

This commit is contained in:
Jeremy Stretch
2018-10-26 12:25:11 -04:00
parent 4ad7882762
commit 3518d023dc
4 changed files with 64 additions and 6 deletions

View File

@ -69,6 +69,8 @@ class ChoiceField(Field):
super(ChoiceField, self).__init__(**kwargs)
def to_representation(self, obj):
if obj is '':
return None
return {'value': obj, 'label': self._choices[obj]}
def to_internal_value(self, data):