'1 - Return unique statuses as a list of dictionaries containing the following key value pairs
{\'status\': \'status value from db\', \'count\': \'occurrence count of the status\'},
2 - if flat is \'True\' then return unique statuses as a list
3 - if course_key is given then return unique statuses associated with the given course
:param course_key: Course Key identifier
:param flat: boolean showing whether to return statuses as a list of values or a list of dictionaries.'

@classmethod
def get_unique_statuses(cls, course_key=None, flat=False):

    query = cls.objects
    if course_key:
        query = query.filter(course_id=course_key)
    if flat:
        return query.values_list('status', flat=True).distinct()
    else:
        return query.values('status').annotate(count=Count('status'))
