Opened 4 years ago
Last modified 4 years ago
#32380 closed New feature
GeoDjango lookups must be accept F() input — at Initial Version
Reported by: | Mohammad Hasanzadeh | Owned by: | nobody |
---|---|---|---|
Component: | GIS | Version: | 3.0 |
Severity: | Normal | Keywords: | geodjango |
Cc: | Simon Charette | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
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
.
Note:
See TracTickets
for help on using tickets.