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

IPAddress.status to slug (#3569)

This commit is contained in:
Jeremy Stretch
2019-11-27 21:54:01 -05:00
parent 929c0648d0
commit ba8f324b12
7 changed files with 80 additions and 22 deletions

View File

@@ -25,3 +25,29 @@ class PrefixStatusChoices(ChoiceSet):
STATUS_RESERVED: 2,
STATUS_DEPRECATED: 3,
}
#
# IPAddresses
#
class IPAddressStatusChoices(ChoiceSet):
STATUS_ACTIVE = 'active'
STATUS_RESERVED = 'reserved'
STATUS_DEPRECATED = 'deprecated'
STATUS_DHCP = 'dhcp'
CHOICES = (
(STATUS_ACTIVE, 'Active'),
(STATUS_RESERVED, 'Reserved'),
(STATUS_DEPRECATED, 'Deprecated'),
(STATUS_DHCP, 'DHCP'),
)
LEGACY_MAP = {
STATUS_ACTIVE: 1,
STATUS_RESERVED: 2,
STATUS_DEPRECATED: 3,
STATUS_DHCP: 5,
}