@classmethod
def latest_previous_record(cls, site, course_id, date_for=None):
    """
        Get the most recent record before the given date

        This is a convenience method to retrieve the most recent record before
        the date given in the `date_for` argument
        If `date_for` is provided, then the latest date before `date_for` is
        found
        """
    filter_args = dict(site=site, course_id=course_id)
    if date_for:
        filter_args['date_for__lt'] = date_for
    return cls.objects.filter(**filter_args).order_by('-date_for').first()
