Opened 9 years ago
Last modified 9 years ago
#25579 closed Bug
ArrayField query/lookup regression — at Initial Version
Reported by: | Matt C | Owned by: | |
---|---|---|---|
Component: | contrib.postgres | Version: | 1.8 |
Severity: | Normal | Keywords: | ArrayField query lookup |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This commit: https://github.com/django/django/commit/39d95fb6ada99c59d47fa0eae6d3128abafe2d58 replaces the get_prep_value
method with get_db_prep_value
and I believe this causes a regression with regards to querying on an ArrayField.
get_db_prep_value
is never called during querying/lookup, hence the array items/values are passed directly to the low-level database Python wrappers without first being transformed (from Python objects to SQL-friendly parameters).
See this question: http://stackoverflow.com/questions/33250371/arrayfield-class-missing-query-lookup-methods
Could both the get_prep_value
and get_db_prep_value
methods be overridden with duplicate/shared logic to overcome this issue?