#28006: allow D to be used with lookups on Distance annotation
-------------------------------------------+------------------------
               Reporter:  Sergey Fedoseev  |          Owner:  nobody
                   Type:  New feature      |         Status:  new
              Component:  GIS              |        Version:  master
               Severity:  Normal           |       Keywords:
           Triage Stage:  Unreviewed       |      Has patch:  0
    Needs documentation:  0                |    Needs tests:  0
Patch needs improvement:  0                |  Easy pickings:  0
                  UI/UX:  0                |
-------------------------------------------+------------------------
 {{{
 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'
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28006>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.4305f7e2a47d25c00645f903e09d89ff%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to