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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user