#12390 closed (fixed)
distance query doesn't support * operand type
| Reported by: | dingle | Owned by: | nobody |
|---|---|---|---|
| Component: | GIS | Version: | dev |
| Severity: | Keywords: | geodjango distance | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Example:
>>>d1 = D(mi=10) >>>d2 = D(mi=20) >>>qs = SouthTexasCity.objects.filter(point__distance_gte=(pnt, 0.5*d1 + 0.5*d2))
It raised:
TypeError: unsupported operand type(s) for *: 'float' and 'Distance'
But obviously it works fine with addition and subtraction. I think it will be nice that
multiplication be implemented as well.
Change History (3)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:3 by , 16 years ago
Note:
See TracTickets
for help on using tickets.
Mutiplication is supported, but only in right form: d1*0.5 would work. But yes, rmul seem to be forgotten at Distance class.