mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[4.1.x] Fixed #33905 -- Fixed CheckConstraint() validation on range fields.
Bug in667105877e. Backport ofe0ae1363ecfrom main
This commit is contained in:
committed by
Mariusz Felisiak
parent
6b0193146d
commit
e215948f0d
@@ -78,6 +78,9 @@ class RangeField(models.Field):
|
||||
def _choices_is_value(cls, value):
|
||||
return isinstance(value, (list, tuple)) or super()._choices_is_value(value)
|
||||
|
||||
def get_placeholder(self, value, compiler, connection):
|
||||
return "%s::{}".format(self.db_type(connection))
|
||||
|
||||
def get_prep_value(self, value):
|
||||
if value is None:
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user