title: .add() .set() on m2m relation django not working as expected
body: <p>I have some troubles with m2m relation in Django. I'm working on sqlite db local and mysql on production.</p>
  <p>Locally everything is working as I expected (with shell and admin panel). But I have issues on production. Relation Artwork-ArtCollection is defined in Artwork model:</p>
  <pre class="lang-py prettyprint-override"><code>class Artwork(models.Model):
      ...
      art_collections = models.ManyToManyField(&quot;ArtCollection&quot;, related_name=&quot;artworks&quot;, blank=True)
  </code></pre>
  <p>According to the <a href="https://docs.djangoproject.com/en/4.0/topics/db/examples/many_to_many/" rel="nofollow noreferrer">https://docs.djangoproject.com/en/4.0/topics/db/examples/many_to_many/</a> Adding a second time to m2m relation is OK, it will not duplicate the relation:</p>
  <pre><code>&gt;&gt;&gt; a2.publications.add(p3)
  </code></pre>
  <p>but when I run</p>
  <pre><code>artwork = Artwork.objects.get(pk=1)
  art_collection = ArtCollection.objects.get(pk=1)
  artwork.art_collections.add(art_collection)
  </code></pre>
  <p>even when the relation already exists the .count() method returns count += 1 and I have duplicated relation (or multipled by 3, 4, 5 if I will countinue running .add(art_collection)
  In shell I can clear the relations only by .clear() method, can not use artwork.art_collections.set([art_collection])</p>
  <p>When I try to delete art_collections ids on admin panel (I have raw_id_field) - nothing happens. Those are my methods on ArtworkAdmin</p>
  <pre><code>    def save_model(self, request, obj, form, change):
          super().save_model(request, obj, form, change)
  
      def save_related(self, request, form, formsets, change):
          super(ArtworkAdmin, self).save_related(request, form, formsets, change)
  </code></pre>
  <p>what is interesting - form.cleaned_data['art_collections'] return qs with only one instance of ArtCollection - no matter if there are 5 when I clicked save button or 1 or 2 duplicated ids was deleted.</p>
  <p>This is how the form looks:</p>
  <pre><code>from dal import autocomplete
  
  class ArtWorkForm(autocomplete.FutureModelForm):
  
      def __init__(self, *args, **kwargs):
          super().__init__(*args, **kwargs)
  
      class Meta:
          model = Artwork
          fields = (
              ...
              &quot;art_collections&quot;,
          )
          widgets = {
              ...
          }
          help_texts = {
              ...
          }
  </code></pre>
  <p>Thanks for any advices.</p>