title: Form object has no attribute 'save_m2m' django
body: <p>I have some trouble with form in views, i created CBV CreateView. So it working good and it saves the form but i have error 'ProductForm' object has no attribute 'save_m2m, if i don`t use form.save_m2m it will not add images to my product, but will add it to media.</p>
  
  <p>So here we have model.py</p>
  
  <pre><code>class Product(models.Model):
      class Meta:
          verbose_name = 'Продукт'
          verbose_name_plural = 'Продукты'
  
      shop = models.ForeignKey(Shop, verbose_name='Название магазина')
      category = models.ForeignKey(Category, verbose_name='Название категории')
      title = models.CharField(max_length=255, verbose_name='Название товара')
      slug = models.SlugField(_("Название на транслите"), max_length=50, unique=True, blank=True, null=True)
      price = models.DecimalField(null=True, blank=True, verbose_name='Цена', decimal_places=0, max_digits=10)
      sell_count = models.PositiveIntegerField(_("Количество продаж"), default=0, null=True, blank=True)
      discount = models.PositiveIntegerField(null=True, blank=True, verbose_name='Скидка')
      currency = models.CharField(null=True, max_length=255, verbose_name='Валюта', default='сом')
      quantity = models.IntegerField(verbose_name='Количество', default=0)
      delivery_type = models.CharField(verbose_name='Вид доставки', choices=DELIVERY_TYPES, default='self',
                                       max_length=255)
      delivery_cost = models.FloatField(verbose_name='Стоимость доставки', default=0, null=True, blank=True)
      # settings = models.ManyToManyField('ProductSettings', verbose_name='Характеристика')
      availability = models.CharField(_("Наличие"), max_length=100, choices=AVAILABILITY_TYPES, default='available')
      published = models.BooleanField(default=True)
      short_description = models.TextField(max_length=300, null=True, blank=True,
                                           verbose_name='Короткое описание товара до 300 символов')
      long_description = RichTextUploadingField(null=True, blank=True, verbose_name='Полное описание')
      images = models.ManyToManyField('Media', verbose_name='Изображения продукта', blank=True)
      objects = ProductPublishedManager()
  
  
  
  class Media(models.Model):
      class Meta:
          verbose_name = "Изображение"
          verbose_name_plural = "Изображения"
  
      image = models.ImageField(upload_to='images')
  </code></pre>
  
  <p>Here i have forms.py</p>
  
  <pre><code>class ProductForm(forms.ModelForm):
      class Meta:
          model = Product
          exclude = ['slug', 'objects', 'sell_count']
  
      removed_images = forms.CharField(required=False)
      uploaded_images = forms.CharField(required=False)
  
      def __init__(self, *args, **kwargs):
          self.user = kwargs['initial']['user']
          super(ProductForm, self).__init__(*args, **kwargs)
          self.fields['shop'].queryset = Shop.objects.filter(user__in=[self.user.id])
          for field in iter(self.fields):
              self.fields[field].widget.attrs.update({
                  'class': 'form-control'
              })
  </code></pre>
  
  <p>And here is views.py</p>
  
  <pre><code>class ProductCreateView(LoginRequiredMixin, AddProductMixin, CreateView):
      form_class = ProductForm
      template_name = 'product/product_form.html'
  
      def get_success_url(self):
          return reverse('shops:detail', args=(self.object.shop.slug,))
  
      def get_initial(self):
          return {'shop': Shop.objects.get(slug=self.kwargs['slug']),
                  'user': self.request.user
                  }
  
      def form_valid(self, form, **kwargs):
          product = form.instance
          product.slug = slugify(form.instance.title)
          product.shop = Shop.objects.get(slug=self.kwargs['slug'])
          form.save()
          if form.cleaned_data['uploaded_images']:
              if ',' in form.cleaned_data['uploaded_images']:
                  for item in form.cleaned_data['uploaded_images'].split(','):
                      try:
                          media = Media.objects.get(id=int(item))
                          product.images.add(media)
                      except ObjectDoesNotExist:
                          pass
              else:
                  try:
                      media = Media.objects.get(id=int(form.cleaned_data['uploaded_images']))
                      product.images.add(media)
                  except ObjectDoesNotExist:
                      print('error')
          form.save_m2m()
          if form.cleaned_data['removed_images']:
              for item in form.cleaned_data['removed_images'].split(','):
                  try:
                      media = Media.objects.get(id=int(item))
                      image_path = MEDIA_ROOT + '/' + media.image.name
                      os.remove(image_path)
                      media.delete()
                  except ObjectDoesNotExist:
                      pass
  
          return super(ProductCreateView, self).form_valid(form)
  </code></pre>