How to sum annotation values ​by groupby in Django

In Django, an error occurs when calculating (Sum) with the value obtained by annotate rather than as a unique field of the model. Is it possible to calculate with only unique fields? I want to find Sum by groupby 'enroll_injection' value into 'student__research' .

enroll_injection = test.filter(Q(student__is_deleted=0))\
                       .annotate(enroll_injection=Cast(F('enroll_date'), DateField()) - Cast(F('injection_date'), DateField()))\
                       .values('assignment__research__research_name', 'enroll_injection')\

Error: Cannot compute Sum('<CombinedExpression: Cast(F(enroll_date)) - Cast(F(injection_date))>'): '<CombinedExpression: Cast(F(enroll_date)) - Cast(F(injection_date))>' is an aggregate

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum