docs: def to_internal_value(self, data):
          """Format the internal value."""
          # When setting the contributor, it may be passed as an integer.
          if isinstance(data, dict) and isinstance(data.get('id', None), int):
              data = data['id']
          elif isinstance(data, int):
              pass
          else:
              raise ValidationError("Contributor must be an integer or a dictionary with key 'id'")
  
          return self.Meta.model.objects.get(pk=data)