title: Django IntegretyError, when try to change ManyToMany field's value
body: <h2>models.py</h2>
  
  <pre><code>class BaseMedia(AbstractObject):
      staff = models.ManyToManyField('main.Profession', blank=True)
      # etc
  
  class Profession(Id):
      profession = models.CharField(max_length=15)
      creator = models.ForeignKey('main.Creator', on_delete=models.CASCADE)
      character = models.ForeignKey('main.Character', on_delete=models.CASCADE, null=True, blank=True)
  </code></pre>
  
  <h2>forms.py</h2>
  
  <pre><code>for profession, staff in staff.items():
      for person in staff:
          professions.append(Profession.objects.update_or_create(
              profession=profession,
              creator_id=person.get('creator_id'),
              character_id=person.get('character_id')
          )[0])
  
  instance.staff.set(professions)
  </code></pre>
  
  <p><code>instance.staff.set(professions)</code> from <strong>forms.py</strong> raise:</p>
  
  <pre><code>django.db.utils.IntegrityError: update or delete on table "main_profession" violates 
  foreign key constraint "main_basemedia_staff_profession_id_075458d2_fk_main_prof" on 
  table "main_basemedia_staff"
  
  DETAIL:  Key (id)=(dd032d79-d458-4ead-b05b-da3b419b58a0) is still referenced from table 
  "main_basemedia_staff".
  </code></pre>
  
  <p>I absolutely have no idea that's the point of this trouble.</p>