def get_value_for_datastore(self, model_instance):
    return getattr(model_instance, self.__id_attr_name())
Get key of reference rather than reference itself.
dataset/ETHPy150Open CollabQ/CollabQ/.google_appengine/google/appengine/ext/db/__init__.py/ReferenceProperty.get_value_for_datastore