Comment

Peter Bengtsson

That's awesome! I'm not on my computer so I can't test it but it'd be fast.

Parent comment

James Bennett

Try this: from django.contrib.postgres.aggregates import StringAgg from django.db.models import Func result = Song.objects.filter( artist=artist ).aggregate( names_hash=Func( StringAgg('name', ''), function='md5' ) )