title: Django form: ManyToMany inline creation
body: <p>I would like to be able to let users create locations "on-the-fly" when they create a report. Using the following models if possible.</p>
  
  <p>models: </p>
  
  <pre><code>class Report(models.Model):
      ...
      location = forms.ManyToManyField(Location)
  
  class Location(models.Model):
      name = forms.CharField(max_length=255)
      ...
  </code></pre>
  
  <p>The behavior I am searching for is close to the one given by the django formsets. </p>
  
  <p>Indeed I am currently able to somewhat do that using instead a foreignkey relationship and relying on formsets. Using this technic,<a href="https://github.com/AndrewIngram/django-extra-views" rel="nofollow">django-extra-views</a> and <a href="https://github.com/elo80ka/django-dynamic-formset" rel="nofollow">django-dynamic-formset</a>, I am even able to let users choose how many locations they want to add. </p>
  
  <p>A strip down version of the actual setup :</p>
  
  <p>models: </p>
  
  <pre><code>class Report(models.Model):
      ...
  
  class Location(models.Model):
      name = forms.CharField(max_length=255)
      report = forms.ForeignKey('Report')
  </code></pre>
  
  <p>forms:</p>
  
  <pre><code>class LocationForm(forms.ModelForm):
      class Meta:
          model = Location
          fields = '__all__'
  
  class LocationFormSet(extra_views.InlineFormSet):
      model = TestLocation
      form_class = TestLocationForm
  </code></pre>
  
  <p>views:</p>
  
  <pre><code>class ReportCreateView(extra_views.CreateWithInlinesView):
      model = Report
      inlines = [LocationFormSet, ]
  </code></pre>
  
  <p>Unfortunately using this setup, a location can not belong to more than one report which bring a lot of duplicated location. That's why I think the ManyToMany relationship would be better suited. I stumbled upon some answers related to this question that talked about intermediary model but I wasn't able to go anywhere on my own to make it work.</p>
  
  <p>Is their a way to tweak my working setup to make it work with a manytomany relationship? Or does it exists a completely  different approach to let user create "on-the-fly" the locations during the report creation?</p>
  
  <p>Thank's!</p>