code: def get_version(model_instance, version):
      
      version_field = get_version_fieldname(model_instance)
      kwargs = {'pk': model_instance.pk, version_field: version}
      return model_instance.__class__.objects.get(**kwargs)
docs: try go load from the database one object with specific version
  
      :param model_instance: instance in memory
      :param version: version number
      :return: