mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Closes #15100: Remove obsolete NullableCharField class
This commit is contained in:
@@ -12,26 +12,10 @@ __all__ = (
|
||||
'ColorField',
|
||||
'CounterCacheField',
|
||||
'NaturalOrderingField',
|
||||
'NullableCharField',
|
||||
'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):
|
||||
default_validators = [ColorValidator]
|
||||
description = "A hexadecimal RGB color code"
|
||||
|
Reference in New Issue
Block a user