title: ValueError: needs to have a value for field "" before this many-to-many relationship can be used
body: <p>Django Version: 1.10.4
  Exception Type: ValueError</p>
  
  <pre><code>Exception Value:    
  "&lt;SchoolBook:  0 test1 Test2 Test3 2011 122&gt;" needs to have a value for field "schoolbook" before this many-to-many relationship can be used.
  </code></pre>
  
  <p>PLease help to avoid this error:</p>
  
  <pre><code>class Subject(models.Model):
      name = models.CharField(max_length=256)
      slug = models.SlugField(max_length=256, blank=True)
  
  def __str__(self):
      return self.name
  
  def save(self, *args, **kwargs):
      if not self.id:
          self.slug = slugify(self.name, separator='_')
      return super(Subject, self).save(*args, **kwargs)
  
  class SchoolBook(models.Model):
      parent_subject = models.ManyToManyField(Subject)
      year = models.SmallIntegerField()
      name = models.CharField(max_length=256,blank=True)
      autors = models.CharField(max_length=256)
      slug = models.SlugField(max_length=256, blank=True, unique=True)
      f_file = models.FileField(upload_to=directory_path)
  
  def __str__(self):
      return '{0} {1} {2}'.format(
          self.name, self.autors, self.year)
  
  def save(self, *args, **kwargs):
      if not self.id:
          subject_name = [self.parent_subject.values()[i]['name'] for i in range(len(self.parent_subject.values()))]
          self.name = ' '.join(subject_name)
          self.slug = slugify("{} {} {} {} {}".format(self.name, self.autors,self.year, self.pages, self.c_class))
      return super(SchoolBook, self).save(*args, **kwargs)
  </code></pre>
  
  <p>the issue is when i am trying to save the object.</p>