Просмотр исходного кода

Closes #2632: Change representation of null values from 0 to 'null'

Jeremy Stretch 7 лет назад
Родитель
Сommit
dffa2d3556
2 измененных файлов с 3 добавлено и 1 удалено
  1. 2 0
      CHANGELOG.md
  2. 1 1
      netbox/netbox/settings.py

+ 2 - 0
CHANGELOG.md

@@ -45,6 +45,7 @@ NetBox now supports modeling physical cables for console, power, and interface c
 * [#2622](https://github.com/digitalocean/netbox/issues/2622) - Enable filtering cables by multiple types/colors
 * [#2622](https://github.com/digitalocean/netbox/issues/2622) - Enable filtering cables by multiple types/colors
 * [#2624](https://github.com/digitalocean/netbox/issues/2624) - Delete associated content type and permissions when removing InterfaceConnection model
 * [#2624](https://github.com/digitalocean/netbox/issues/2624) - Delete associated content type and permissions when removing InterfaceConnection model
 * [#2616](https://github.com/digitalocean/netbox/issues/2616) - Convert Rack `outer_unit` and Cable `length_unit` to integer-based choice fields
 * [#2616](https://github.com/digitalocean/netbox/issues/2616) - Convert Rack `outer_unit` and Cable `length_unit` to integer-based choice fields
+* [#2632](https://github.com/digitalocean/netbox/issues/2632) - Change representation of null values from `0` to `null`
 * [#2639](https://github.com/digitalocean/netbox/issues/2639) - Fix preservation of length/dimensions unit for racks and cables
 * [#2639](https://github.com/digitalocean/netbox/issues/2639) - Fix preservation of length/dimensions unit for racks and cables
 
 
 ## API Changes
 ## API Changes
@@ -66,6 +67,7 @@ NetBox now supports modeling physical cables for console, power, and interface c
 * Added a `description` field to the CircuitTermination serializer
 * Added a `description` field to the CircuitTermination serializer
 * Added `ipaddress_count` to InterfaceSerializer to show the count of assigned IP addresses for each interface
 * Added `ipaddress_count` to InterfaceSerializer to show the count of assigned IP addresses for each interface
 * The `available-prefixes` and `available-ips` IPAM endpoints now return an HTTP 204 response instead of HTTP 400 when no new objects can be created
 * The `available-prefixes` and `available-ips` IPAM endpoints now return an HTTP 204 response instead of HTTP 400 when no new objects can be created
+* Filtering on null values now uses the string `null` instead of zero
 
 
 ---
 ---
 
 

+ 1 - 1
netbox/netbox/settings.py

@@ -247,7 +247,7 @@ SECRETS_MIN_PUBKEY_SIZE = 2048
 
 
 # Django filters
 # Django filters
 FILTERS_NULL_CHOICE_LABEL = 'None'
 FILTERS_NULL_CHOICE_LABEL = 'None'
-FILTERS_NULL_CHOICE_VALUE = '0'  # Must be a string
+FILTERS_NULL_CHOICE_VALUE = 'null'
 
 
 # Django REST framework (API)
 # Django REST framework (API)
 REST_FRAMEWORK_VERSION = VERSION[0:3]  # Use major.minor as API version
 REST_FRAMEWORK_VERSION = VERSION[0:3]  # Use major.minor as API version