def get_latest_for_name(self, klass_name, project_name):
        qs = self.filter(
            name=klass_name,
            module__project_version__project__name=project_name,
        ) or self.filter(
            name__iexact=klass_name,
            module__project_version__project__name__iexact=project_name,
        )
        try:
            obj = qs.order_by('-module__project_version__version_number',)[0]
        except __HOLE__:
            raise self.model.DoesNotExist
        else:
            return obj


# TODO: quite a few of the methods on here should probably be denormed.
dataset/ETHPy150Open refreshoxford/django-cbv-inspector/cbv/models.py/KlassManager.get_latest_for_name