#34539: `get_prep_value` no longer called for JSONField
-------------------------------------+-------------------------------------
Reporter: Julie Rymer | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mariusz Felisiak):
Replying to [comment:11 Julie Rymer]:
> {{{
> def get_prep_value(self, value):
> """Perform preliminary non-db specific value checks and
conversions."""
> if isinstance(value, Promise):
> value = value._proxy____cast()
> return value
> }}}
>
> So it doesn't seems to do much so I don't see what backward incompatible
change that would cause.
The number of LOC is not important. We are talking not only about
`JSONField`. If we will agree that all built-in fields must implement the
entire `Field` API and fulfill everything that is in the `Field` API
reference, we will be force to make many other changes.
> This addition to the code **will be tested**, because
`get_db_prep_value` is already tested (right?)
This is not true, removing `get_prep_value()` will not cause any tests to
fail, so it won't be tested.
> On the contrary, updating the documentation to keep track of any Field
class not following the rule and explaining how to do customisation for
each of them seems like a lot more involved effort.
Personally, I'd close this ticket as invalid. As far as I'm aware, neither
docs nor code changes are required.
--
Ticket URL: <https://code.djangoproject.com/ticket/34539#comment:12>
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/01070187e779eff5-83663f9e-8bb8-467f-b4ab-441f3ed59ff2-000000%40eu-central-1.amazonses.com.