1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #35167 -- Delegated to super() in JSONField.get_db_prep_save().

Avoids reports of bulk_update() sending Cast expressions
to JSONField.get_prep_value().

Co-authored-by: Simon Charette <charette.s@gmail.com>
This commit is contained in:
Jacob Walls
2025-02-16 21:35:12 -05:00
committed by Sarah Boyce
parent 9d22a7d8f0
commit 0bf412111b
3 changed files with 41 additions and 8 deletions

View File

@@ -430,6 +430,17 @@ class RelatedJSONModel(models.Model):
required_db_features = {"supports_json_field"}
class CustomSerializationJSONModel(models.Model):
class StringifiedJSONField(models.JSONField):
def get_prep_value(self, value):
return json.dumps(value, cls=self.encoder)
json_field = StringifiedJSONField()
class Meta:
required_db_features = {"supports_json_field"}
class AllFieldsModel(models.Model):
big_integer = models.BigIntegerField()
binary = models.BinaryField()