title: Django Rest Framework - How to add custom field in ModelSerializer
body: <p>I created a <code>ModelSerializer</code> and want to add a custom field which is not part of my model.</p>
  
  <p>I found a description to add extra fields <a href="https://www.django-rest-framework.org/api-guide/serializers/#specifying-fields-explicitly" rel="noreferrer">here</a> and I tried the following:</p>
  
  <pre><code>customField = CharField(source='my_field')
  </code></pre>
  
  <p>When I add this field and call my <code>validate()</code> function then this field is not part of the <code>attr</code> dict. <code>attr</code> contains all model fields specified except the extra fields. So I cannot access this field in my overwritten validation, can I?</p>
  
  <p>When I add this field to the field list like this:</p>
  
  <pre><code>class Meta:
      model = Account
      fields = ('myfield1', 'myfield2', 'customField')
  </code></pre>
  
  <p>then I get an error because <code>customField</code> is not part of my model - what is correct because I want to add it just for this serializer.</p>
  
  <p>Is there any way to add a custom field?</p>