def last_run(self):
        "Returns the last completed run or None"
        try:
            query = RunInfoHistory.objects.filter(subject=self)
            return query.order_by('-completed')[0]
        except __HOLE__:
            return None
dataset/ETHPy150Open seantis/seantis-questionnaire/questionnaire/models.py/Subject.last_run