4 ms·
It's possible with the ORM, but much more complicated than the SQL you intend to get: AppComment.objects.annotate(content_len=Length('content')).all().aggregat
by andor 11y ago
It's possible with the ORM, but much more complicated than the SQL you intend to get:
AppComment.objects.annotate(content_len=Length('content')).all().aggregate(Sum('content_len'))
https://docs.djangoproject.com/en/1.9/ref/models/expressions/ https://docs.djangoproject.com/en/1.9/ref/models/expressions...