'Queries all the grades in the table, filtered by the provided arguments.'

@classmethod
def query_grades(cls, course_ids=None, modified_start=None, modified_end=None):

    kwargs = {}
    if course_ids:
        kwargs['course_id__in'] = [course_id for course_id in course_ids]
    if modified_start:
        if modified_end:
            kwargs['modified__range'] = (modified_start, modified_end)
        else:
            kwargs['modified__gt'] = modified_start
    return cls.objects.filter(**kwargs)
