"SELECT field as x ..." with Django ORM
2 answers
Currently the Django documentation says to be used as a last resort .
So, here's the best way to make this request:
from django.db.models import F
Foo.objects.filter(cond=1).annotate(sth_shiny=F('my_field'))
+6
source to share