def get_value_for_datastore(self, model_instance):
    """Translate model property to datastore value."""
    blob_info = getattr(model_instance, self.name)
    if blob_info is None:
      return None
    return blob_info.key()
Translate model property to datastore value.
mapreduce/lib/blobstore/blobstore.py