'Determine if a resolution exists for the given group and release.
This is used to suggest if a regression has occurred.'

@classmethod
def has_resolution(cls, group, release):

    try:
        (res_type, res_release, res_release_datetime) = cls.objects.filter(group=group).select_related('release').values_list('type', 'release__id', 'release__date_added')[0]
    except IndexError:
        return False
    if (not release):
        return True
    if (res_type in (None, cls.Type.in_next_release)):
        if (res_release == release.id):
            return True
        elif (res_release_datetime > release.date_added):
            return True
        return False
    elif (res_type == cls.Type.in_release):
        if (res_release == release.id):
            return False
        if (res_release_datetime < release.date_added):
            return False
        return True
    else:
        raise NotImplementedError
