title: DjangoRestFramework ModelSerializer: field-level validation is not working
body: <p>This is my serializers.py (I want to create a serializer for the built-in User model):</p>
  
  <pre><code>from rest_framework import serializers
  
  from django.contrib.auth.models import User
  
  class UserSerializer(serializers.ModelSerializer):
  
      class Meta:
          model = User
          fields = ('username', 'password', 'email', )
  
      def validate_username(self, username):
          if not re.search(r'^\w+$', username): #checks if all the characters in username are in the regex. If they aren't, it returns None
              raise serializers.ValidationError('Username can only contain alphanumeric characters and the underscore.')
          try:
              User.objects.get(username=username)
          except ObjectDoesNotExist:
              return username
          raise serializers.ValidationError('Username is already taken.')
  </code></pre>
  
  <p>The issue is, when I try to create a user using a username which already exists, it returns the following dictionary:</p>
  
  <pre><code>{'username': [u'This field must be unique.']}
  </code></pre>
  
  <p>rather than saying</p>
  
  <pre><code>{'username': [u'Username is already taken']}
  </code></pre>
  
  <p>I recreated the validate_username function to this (for testing purposes):</p>
  
  <pre><code>    def validate_username(self, username):
          raise serializers.ValidationError('Testing to see if an error is raised.')
  </code></pre>
  
  <p>and it doesn't raise an error. Any idea why DjangoRestFramework is ignoring the validate_username function?</p>
  
  <p>Edit: Note that I am using a ModelSerializer (in the tutorial here: <a href="http://www.django-rest-framework.org/api-guide/serializers/#validation" rel="noreferrer">http://www.django-rest-framework.org/api-guide/serializers/#validation</a> it talks about field-level validation only for a Serializer, not a ModelSerializer). Note sure if it makes a difference or not.</p>