#34539: `get_prep_value` no longer called for JSONField
-------------------------------------+-------------------------------------
Reporter: Julie Rymer | Owner: (none)
Type: Bug | Status: new
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):
I don't hold a strong opinion against restoring the call to
`get_prep_value` given how common using `JSONField` to persist Python
datastructure is.
I never assumed that we guaranteed that `get_prep_lookup` would be called
by `get_db_prep_lookup` but I can see how it can be interpreted this way
from the docs.
Given this was an unintended side-effect of
5c23d9f0c32f166c81ecb6f3f01d5077a6084318 I'd be +1 to having
`get_db_prep_value` start by calling `get_prep_value` when
`prepared=False`.
As for the other fields that don't respect this contract that Mariusz
identified I think that if we wanted to be coherent with the docs we
should likely adapt them as well in a follow up ticket.
For as much as this API is awkward and open to interpretation it has been
around for years so trying to stick to it as much as possible seems like a
worthy approach?
--
Ticket URL: <https://code.djangoproject.com/ticket/34539#comment:19>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070187f8c16cf9-7000b39a-9991-4a49-9227-4b26a236cf1a-000000%40eu-central-1.amazonses.com.