'Returns the previous approved revision or None.'

def get_previous(self):

    try:
        return self.document.revisions.filter(is_approved=True, created__lt=self.created).order_by('-created')[0]
    except IndexError:
        return self.based_on
