Opened 12 years ago
Closed 8 years ago
#18565 closed Bug (wontfix)
Point object doesn't work in queyset.extra params argument
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | GIS | Version: | 1.4 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
While using GIS objects in queryset lookups (like distance etc) works OK, these objects don't work when passed as params
argument in queryset.extra
function.
queryset = queryset.extra(where=['mm_hitchhiker_search("move_move"."path", %s, %s)'], params=[from_waypoint.point, to_waypoint.point])
Change History (4)
comment:2 by , 12 years ago
Triage Stage: | Unreviewed → Accepted |
---|
Basically, a standard WhereNode
go through: as_sql() -> make_atom() (from contrib.gis) -> lvalue.process() -> field.get_db_prep_lookup() -> connection.ops.Adapter(point)
An ExtraWhere
is much more simple and just inject the params in the sql string.
I suspect this will end up in a documentation fix to explain the limitation (or tell to manually call the Adapter() method?). We need an ORM guru to confirm.
comment:3 by , 11 years ago
Summary: | Point object doesn't work in quqeyset.extra params argument → Point object doesn't work in queyset.extra params argument |
---|
comment:4 by , 8 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Closing since we aren't fixing issues with QuerySet.extra()
. It'll be deprecated once obsoleted.
Oh fuck. I didn't provide explanation.
Following snippet:
produces error: