title: Django unique model fields validation in form
body: <p>I have a model with a few unique fields and I'm writing a form for it. I found some reference to the <code>[validate_unique][1]</code> method that should check for uniqueness on fields when you call it but my form <code>.is_valid()</code> always returns <code>True</code>.</p>
  
  <p>My testcase:</p>
  
  <pre><code>class ServerFormTest( TestCase ):
      def setUp( self ):
          self.server = Server.objects.create( host = "127.0.0.1", name = "localhost" )
  
      def test_unique_name(self):
          form = ServerForm({
              'name': 'localhost',
              'host': '127.0.0.1'
          })
  
          self.assertFalse( form.is_valid( ) )
  </code></pre>
  
  <p>and my form:</p>
  
  <pre><code>class ServerForm( forms.ModelForm ):
      class Meta:
          model = Server
          fields = ('name', 'host')
  
      def clean( self ):
          self.validate_unique()
          return self.cleaned_data
  </code></pre>
  
  <p>server model:</p>
  
  <pre><code>class Server( models.Model ):
      host = models.GenericIPAddressField( blank = False, null = False, unique = True )
      name = models.CharField( blank = False, null = False, unique = True, max_length = 55 )
  </code></pre>