'Queries the requested grades in the given model, filtered by the provided args and kwargs.'

def _query_grades(self, grade_model_class, *args, **kwargs):

    total_for_all_courses = 0
    grades_query_set = grade_model_class.query_grades(*args, **kwargs)
    grades_stats = grades_query_set.values('course_id').order_by().annotate(total=Count('course_id'))
    for stat in grades_stats:
        total_for_all_courses += stat['total']
        log.info('reset_grade:    Would    delete    %s    for    COURSE    %s:    %d    row(s).', grade_model_class.__name__, stat['course_id'], stat['total'])
    log.info('reset_grade:    Would    delete    %s    in    TOTAL:    %d    row(s).', grade_model_class.__name__, total_for_all_courses)
