title: Order of Serializer Validation in Django REST Framework
body: <p><strong>Situation</strong></p>
  
  <p>While working with validation in the Django REST Framework's <code>ModelSerializer</code>, I have noticed that the <code>Meta.model</code> fields are always validated, even when it does not necessarily make sense to do so. Take the following example for a <code>User</code> model's serialization:</p>
  
  <ol>
  <li>I have an endpoint that creates a user. As such, there is a <code>password</code> field and a <code>confirm_password</code> field. If the two fields do not match, the user cannot be created. Likewise, if the requested <code>username</code> already exists, the user cannot be created.</li>
  <li>The user POSTs improper values for each of the fields mentioned above</li>
  <li>An implementation of <code>validate</code> has been made in the serializer (see below), catching the non-matching <code>password</code> and <code>confirm_password</code> fields</li>
  </ol>
  
  <p>Implementation of <code>validate</code>:</p>
  
  <pre><code>def validate(self, data):
      if data['password'] != data.pop('confirm_password'):
          raise serializers.ValidationError("Passwords do not match")
      return data
  </code></pre>
  
  <p><strong>Problem</strong></p>
  
  <p>Even when the <code>ValidationError</code> is raised by <code>validate</code>, the <code>ModelSerializer</code> still queries the database to check to see if the <code>username</code> is already in use. This is evident in the error-list that gets returned from the endpoint; both the model and non-field errors are present.</p>
  
  <p>Consequently, I would like to know how to prevent model validation until after non-field validation has finished, saving me a call to my database.</p>
  
  <p><strong>Attempt at solution</strong></p>
  
  <p>I have been trying to go through the DRF's source to figure out where this is happening, but I have been unsuccessful in locating what I need to override in order to get this to work.</p>