#12390 closed (fixed)
distance query doesn't support * operand type
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 , 15 years ago
comment:2 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 15 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.