mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 09:51:22 -06:00
Closes #15100: Remove obsolete NullableCharField class
This commit is contained in:
parent
d8c6dad9d9
commit
25723aebe0
@ -31,3 +31,4 @@ The NetBox user interface has been completely refreshed and updated.
|
|||||||
* [#14658](https://github.com/netbox-community/netbox/issues/14658) - Remove backward compatibility for importing `process_webhook()` (now `extras.webhooks.send_webhook()`)
|
* [#14658](https://github.com/netbox-community/netbox/issues/14658) - Remove backward compatibility for importing `process_webhook()` (now `extras.webhooks.send_webhook()`)
|
||||||
* [#14740](https://github.com/netbox-community/netbox/issues/14740) - Remove the obsolete `BootstrapMixin` form mixin class
|
* [#14740](https://github.com/netbox-community/netbox/issues/14740) - Remove the obsolete `BootstrapMixin` form mixin class
|
||||||
* [#15099](https://github.com/netbox-community/netbox/issues/15099) - Remove obsolete `device_role` and `device_role_id` filters for devices
|
* [#15099](https://github.com/netbox-community/netbox/issues/15099) - Remove obsolete `device_role` and `device_role_id` filters for devices
|
||||||
|
* [#15100](https://github.com/netbox-community/netbox/issues/15100) - Remove obsolete `NullableCharField` class
|
||||||
|
@ -12,26 +12,10 @@ __all__ = (
|
|||||||
'ColorField',
|
'ColorField',
|
||||||
'CounterCacheField',
|
'CounterCacheField',
|
||||||
'NaturalOrderingField',
|
'NaturalOrderingField',
|
||||||
'NullableCharField',
|
|
||||||
'RestrictedGenericForeignKey',
|
'RestrictedGenericForeignKey',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# Deprecated: Retained only to ensure successful migration from early releases
|
|
||||||
# Use models.CharField(null=True) instead
|
|
||||||
# TODO: Remove in v4.0
|
|
||||||
class NullableCharField(models.CharField):
|
|
||||||
description = "Stores empty values as NULL rather than ''"
|
|
||||||
|
|
||||||
def to_python(self, value):
|
|
||||||
if isinstance(value, models.CharField):
|
|
||||||
return value
|
|
||||||
return value or ''
|
|
||||||
|
|
||||||
def get_prep_value(self, value):
|
|
||||||
return value or None
|
|
||||||
|
|
||||||
|
|
||||||
class ColorField(models.CharField):
|
class ColorField(models.CharField):
|
||||||
default_validators = [ColorValidator]
|
default_validators = [ColorValidator]
|
||||||
description = "A hexadecimal RGB color code"
|
description = "A hexadecimal RGB color code"
|
||||||
|
Loading…
Reference in New Issue
Block a user