title: Exclude history fields from django simples history on to_representation method in django rest framework
body: <p>I'm using Django Rest Framework with django-simple-history and currently I would like to return the history modifications in my <code>Board</code> rest API, currently it is doing well but I would like to hide some fields. This is the currently output:</p>
  <p><a href="https://i.stack.imgur.com/80irC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/80irC.png" alt="enter image description here" /></a></p>
  <p>But, I don't need <code>id</code>, <code>history_id</code>, etc.</p>
  <p>my implementation is the same of alexander answer in this <a href="https://stackoverflow.com/questions/40736838/getting-rest-history-from-django-simple-history">post</a>.
  this is my currently serializers, where I put history on my Board model</p>
  <pre class="lang-py prettyprint-override"><code>class HistoricalRecordField(serializers.ListField):
      child = serializers.DictField()
  
      def to_representation(self, data):
          representation = super().to_representation(data.values())
          # i've tried to do it by deleting, but does't work well.
          del representation[0]['history_id']
          return representation
  
  
  class BoardSerializer(serializers.ModelSerializer):
      history = HistoricalRecordField(read_only=True)
  
      class Meta:
          model = Board
          fields = '__all__'
  </code></pre>
  <p>But it does not seem the best way to do it.</p>
  <p>If you have some hint about how to do it the correct way I would like to know.
  Thanks in advance!</p>