docs: def to_python(self, value):
          """Convert value if needed."""
          cache = None
          if value is None:
              return None
  
          if isinstance(value, DataDescriptor):
              return value
          elif isinstance(value, dict):
              # Allow pre-hydrated data objects.
              cache = value
              try:
                  value = cache['__id']
              except KeyError:
                  raise ValidationError("dictionary must contain an '__id' element")
          elif not isinstance(value, int):
              raise ValidationError("field must be a DataDescriptor, data object primary key or dict")
  
          return DataDescriptor(value, self, cache)