title: How to prevent django from swapping primary key values
body: <p>I am creating a Django web app. I have set a field as a primary key and a unique field. When I try to edit it and give it the same value as another item in the primary key column, the current item got duplicated and each value goes to one of them as shown below.</p>
  <p>This is my code from <code>models.py</code>:</p>
  <pre class="lang-py prettyprint-override"><code>class Car(models.Model):
      class Meta:
          verbose_name = &quot;Car&quot;
          verbose_name_plural = &quot;Cars&quot;
  
      car_id = models.CharField(verbose_name='Car ID', max_length=10000, primary_key=True, unique=True)
  </code></pre>
  <p>Some screenshots from the admin panel:</p>
  <p><img src="https://i.stack.imgur.com/snYH3.png" alt="FIG. 1" /></p>
  <p><img src="https://i.stack.imgur.com/00jpd.png" alt="FIG. 2" /></p>
  <p><img src="https://i.stack.imgur.com/k37jS.png" alt="FIG. 3" /></p>
  <p><img src="https://i.stack.imgur.com/ahD9U.png" alt="FIG. 4" /></p>