def get_value_for_form(self, instance):
    value = super(ReferenceProperty, self).get_value_for_form(instance)
    if value is not None:
      value = value.key()
    return value
Extract the property value from the instance for use in a form.
dataset/ETHPy150Open IanLewis/kay/kay/utils/forms/modelform.py/ReferenceProperty.get_value_for_form