title: Django: validation fails for many-to-many field with empty QueryDict as initial data
body: <p><strong>Setup:</strong></p>
  
  <ul>
  <li>Python 3.5.1 with Django 1.9.</li>
  <li>I have a class-based generic view <code>CreateRentView</code> operating on the model <code>Rent</code>. I implemented a custom <code>ModelForm</code> <code>RentForm</code> to implement additional validations (e.g., ensure <code>start_time &lt;= end_time</code>).</li>
  <li>When creating a new <code>Rent</code> (via <code>CreateRentView</code>), first user defines start and end time. This triggers an AJAX request to get the available objects for this time frame and fills the <code>rental_objects</code> HTML widget using Javascript (see screenshot below).</li>
  </ul>
  
  <p><strong>Problem:</strong></p>
  
  <ul>
  <li>Everything is working fine (custom validation and AJAX communication), but when submitting the form I get a validation error for (many-to-many) field <code>rental_objects</code>: <code>Select a valid choice. 1 is not one of the available choices.</code></li>
  <li>Note: in the screenshot below, rental object <code>MB1</code> was selected before submitting the form.</li>
  </ul>
  
  <p>This is caused because I want to initialize the field <code>rental_objects</code> empty. Therefore, method <code>get_form()</code> of class <code>CreateRentView</code> sets form field <code>rental_objects</code> to an empty <code>QuerySet</code>:</p>
  
  <pre><code>def get_form(self):
      form = super(generic.CreateView, self).get_form()
      # Rental objects are retrieved via AJAX after start and end time is defined.
      form.fields["rental_objects"].queryset = RentalObject.objects.none()
  </code></pre>
  
  <p>Obviously this triggers an internal Django validation that ensures that this field is submitted empty.</p>
  
  <p>How can I avoid this validation?</p>
  
  <p>PS: Of course, I could not override <code>get_form()</code> and empty the HTML widget for <code>rental_objects</code> using Javascript. But, this would be just a messy workaround</p>
  
  <p>Django-AJAX-ManyToManyField:</p>
  
  <p><a href="https://i.stack.imgur.com/OimDd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OimDd.png" alt="enter image description here"></a></p>