allow D to be used with lookups on Distance annotation
In [2]: from django.contrib.gis.db.models.functions import Distance
In [6]: City.objects.annotate(d=Distance('point', Point(2, 3, srid=4326))).values_list('d', flat=True).first()
Out[6]: Distance(m=247555.57168135)
In [7]: from django.contrib.gis.measure import D
In [10]: City.objects.annotate(d=Distance('point', Point(2, 3, srid=4326))).values_list('d', flat=True).filter(d=D(m=247555.57168135)).first()
...
TypeError: float() argument must be a string or a number, not 'Distance'
Change History
(5)
Owner: |
changed from nobody to Sergey Fedoseev
|
Status: |
new → assigned
|
Triage Stage: |
Unreviewed → Accepted
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
PR