title: how to save Many to Many relationship in django
body: <p><a href="https://stackoverflow.com/questions/6996176/how-to-create-an-object-for-a-django-model-with-a-many-to-many-field">How to create an object for a Django model with a many to many field?</a> </p>
  
  <p>From above question i come to know we can save Many to Many field later only.</p>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>class Store(models.Model):
     name = models.CharField(max_length=100)
  
  class Foo(models.Model):
     file = models.FileField(upload_to='')
     store = models.ManyToManyField(Store, null=True, blank=True)
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>new_track.file = request.FILES['file']
  new_track.save()
  </code></pre>
  
  <p>And file uploading working fine then later i modify my code to add store then i am here...</p>
  
  <p>Now i am sure db return id's here. Then i tried with my below code but that's given me error only </p>
  
  <pre><code>    x = new_track.id
      new = Foo.objects.filter(id=x)
      new.store.id = request.POST['store']
      new.save()
  </code></pre>
  
  <p>ok so the error here is <code>'QuerySet' object has no attribute 'store'</code></p>
  
  <p>And also i tried with <code>add</code> that's now working either. 
  So the question is how to save()</p>