[Django] #28006: allow D to be used with lookups on Distance annotation

4 views
Skip to first unread message

Django

unread,
Apr 1, 2017, 7:14:37 AM4/1/17
to django-...@googlegroups.com
#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.

Django

unread,
Apr 1, 2017, 7:21:17 AM4/1/17
to django-...@googlegroups.com
#28006: allow D to be used with lookups on Distance annotation
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: New feature | Status: assigned
Component: GIS | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sergey Fedoseev):

* status: new => assigned
* owner: nobody => Sergey Fedoseev


--
Ticket URL: <https://code.djangoproject.com/ticket/28006#comment:1>

Django

unread,
Apr 1, 2017, 8:27:15 AM4/1/17
to django-...@googlegroups.com
#28006: allow D to be used with lookups on Distance annotation
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: New feature | Status: assigned
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/28006#comment:2>

Django

unread,
Apr 3, 2017, 1:20:01 PM4/3/17
to django-...@googlegroups.com
#28006: allow D to be used with lookups on Distance annotation
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: New feature | Status: assigned
Component: GIS | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Sergey Fedoseev):

[https://github.com/django/django/pull/8291 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/28006#comment:3>

Django

unread,
Apr 3, 2017, 1:20:13 PM4/3/17
to django-...@googlegroups.com
#28006: allow D to be used with lookups on Distance annotation
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: New feature | Status: assigned
Component: GIS | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sergey Fedoseev):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/28006#comment:4>

Django

unread,
Apr 6, 2017, 7:27:55 PM4/6/17
to django-...@googlegroups.com
#28006: allow D to be used with lookups on Distance annotation
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: New feature | Status: closed
Component: GIS | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"fd892f3443fe9a35684b7b798a8fe1b07d118e3c" fd892f34]:
{{{
#!CommitTicketReference repository=""
revision="fd892f3443fe9a35684b7b798a8fe1b07d118e3c"
Fixed #28006 -- Allowed using D with lookups on Distance annotations.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28006#comment:5>

Reply all
Reply to author
Forward
0 new messages