title: Django conditional create
body: <p>Does the Django ORM provide a way to conditionally create an object?</p>
  
  <p>For example, let's say you want to use some sort of optimistic concurrency control for inserting new objects.<br>
  At a certain point, you know the latest object to be inserted in that table, and you want to only create a new object only if no new objects have been inserted since then.</p>
  
  <p>If it's an update, you could filter based on a revision number:</p>
  
  <pre><code>updated = Account.objects.filter(
      id=self.id,
      version=self.version,
  ).update(
      balance=balance + amount,
      version=self.version + 1,
  )
  </code></pre>
  
  <p>However, I can't find any documented way to provide conditions for a <code>create()</code> or <code>save()</code> call. </p>
  
  <p>I'm looking for something that will apply these conditions at the SQL query level, so as to avoid "read-modify-write" problems.</p>