title: Check if a unique value exists before creating it
body: <p>When Django runs .save() on a primary key attribute, it first does a SELECT to see if it already exists, then decides whether to do an INSERT or an UPDATE. Is there a way to elegantly do the same for a unique but not primary key field?</p>
  
  <p>Basically, if the model looks like this:</p>
  
  <pre><code>class Subject(models.Model):
      name = models.CharField(max_length=64, unique=True)
  </code></pre>
  
  <p>I would want to do the following without throwing an error</p>
  
  <pre><code>&gt;&gt;&gt; s=Subject(name="A new subject")
  &gt;&gt;&gt; s.save()
  &gt;&gt;&gt; s
  &lt;Subject: A subject&gt;
  &gt;&gt;&gt; s=Subject(name="A new subject")
  &gt;&gt;&gt; s.save()
  --- django.db.utils.IntegrityError: column name is not unique
  </code></pre>
  
  <p>Inversely, I could make 'name' the pk, but I wasn't sure of an elegant Django way to make non-pk unique auto-incrementing ids.</p>
  
  <p>Any help is appreciated. Thank you!</p>