I get this error when I try to annotate by `-Sum('field')`:
{{{
TypeError
bad operand type for unary -: 'Sum'
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29066>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Accepted
Comment:
I guess we could add support for `__neg__`, in the mean time `Sum('field')
* -1` which goes through `__mul__` should work just fine.
--
Ticket URL: <https://code.djangoproject.com/ticket/29066#comment:1>
* owner: nobody => Priyansh Saxena
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/29066#comment:2>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/29066#comment:3>
* cc: Adam (Chainz) Johnson (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/29066#comment:4>
* needs_tests: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/29066#comment:5>
* needs_tests: 1 => 0
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/29066#comment:6>
--
Ticket URL: <https://code.djangoproject.com/ticket/29066#comment:7>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"617d5f410fdd5c491c929e5d66ce6f5aa95e45ee" 617d5f41]:
{{{
#!CommitTicketReference repository=""
revision="617d5f410fdd5c491c929e5d66ce6f5aa95e45ee"
Fixed #29066 -- Allowed negating query expressions.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29066#comment:8>