#32380: GeoDjango lookups must be accept F() input
------------------------------------+--------------------------------------
Reporter: mohammadhasanzadeh | Owner: nobody
Type: New feature | Status: new
Component: GIS | Version: 2.2
Severity: Normal | Resolution:
Keywords: geodjango | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+--------------------------------------
Description changed by mohammadhasanzadeh:
Old description:
> For example, if we need to calculate the distance between two model field
> with the `distance_gte` lookup like the following:
>
> {{{
> return
> queryset.filter(checkin_position__distance_gte=(F("doctor_location__location__position"),
> D(km=200)) )
> }}}
>
> We will get the following error:
> `ValueError: Cannot use object with type F for a spatial lookup
> parameter.`
>
> Note that `doctor_location__location__position` is a `PointField`.
New description:
For example, if we need to calculate the distance between two field of the
model with the `distance_gte` lookup like the following:
{{{
return
queryset.filter(checkin_position__distance_gte=(F("doctor_location__location__position"),
D(km=200)) )
}}}
We will get the following error:
`ValueError: Cannot use object with type F for a spatial lookup
parameter.`
Note that `doctor_location__location__position` is a `PointField`.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/32380#comment:1>
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/076.f27e56cbcb9b4a4337daf60109554f17%40djangoproject.com.