I'd like to execute such query using djagno models:
SELECT id, ( first+second+third ) FROM testTable
Without grouping. Was trying to find the solution using google but unsuccessfully.
Thanks in advance,
Use F() and annotate():
from django.db.models import F
# the sum of the three columns `first`, `second` and `third` will be
# accessible as `.my_sum`
results = my_model.objects.annotate(
my_sum=F('first') + F('second') + F('third'),
)