title: Django unique=True not working
body: <p>This is from django's documentation:</p>
  <blockquote>
  <p>Field.unique</p>
  <p>If True, this field must be unique throughout the table.</p>
  <p>This is enforced at the database level and by model validation.
  If you try to save a model with a duplicate value in a unique field, a django
  .db.IntegrityError will be raised by the model’s save() method.</p>
  </blockquote>
  <p>Here is my models.py</p>
  <pre><code>class MyModel(models.Model):
      # my pk is an auto-incrementing field
      url = models.URLField(&quot;URL&quot;, unique=True)
      text = models.TextField(max_length=1000)
      # my model is just two fields, one pk (unique), and another unique field, 
      #, the url
  </code></pre>
  <p>Here my is manage.py sqlall (I ran syncdb)</p>
  <pre><code>CREATE TABLE `MyModel_mymodel` (
      `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
       `url` varchar(200) NOT NULL UNIQUE,
       `text` varchar(1000) NOT NULL,
  </code></pre>
  <p>However, in the manage.py shell, I can freely do this:</p>
  <pre><code>&gt;&gt;&gt; from MyModel.models import MyModel
  &gt;&gt;&gt; MyModel().save() # it works fine!? Not even the text was checked for!
  &gt;&gt;&gt; MyModel(url=&quot;blah&quot;).save() 
  &gt;&gt;&gt; MyModel(url=&quot;blah&quot;).save() # it still works!
  
  # I checked the mysql database afterwards, the models were saved just fine, they
  # however did have different PK's (auto incrementing fields).
  </code></pre>
  <p>I'm using mysql, django 1.5. Does anyone have an idea what could possible be causing this?</p>
  <p>I am using a custom manager, but I doubt that's the issue.</p>
  <p>Thanks.</p>