title: How to use Many-to-many relationships
body: <p>I am using <strong>Many-to-many relationships</strong> in my app and I am not able to feed data into the table which is by default created by the Django to ensure the Many-to-many relationships.It gives the error in method  (<strong>def Set_Checkout_Attributes(request):</strong>) that <strong>'Customer_check_attributes' object has no attribute 'set_customers'</strong> If I replace set_customers with <strong>set_users</strong> the error will remain same. </p>
  
  <p>The models which I used are:</p>
  
  <pre><code>class Customer(models.Model):
      user        =models.OneToOneField(User)
      birthday    =models.DateField()
  
  class Customer_check_attributes(models.Model):
      users       =models.ManyToManyField(User)
      billing_add =models.CharField(max_length=100, blank=True , null=
  </code></pre>
  
  <p>My view.py is as</p>
  
  <pre><code>def CustomerRegistration(request):
      if request.user.is_authenticated():
          return HttpResponseRedirect('/profile/')
      if request.method == 'POST':
          form = Registration_Form(request.POST)
          if form.is_valid():
              user=User.objects.create_user(username=form.cleaned_data['username'], email=form.cleaned_data['email'], password = form.cleaned_data['password'])
              user.first_name = form.cleaned_data['first_name']
              user.last_name = form.cleaned_data['last_name']
              user.save()
  
  
  
              customer=Customer(user=user, website=form.cleaned_data['website'], birthday=form.cleaned_data['birthday'], store=form.cleaned_data['store'], welcomemail=form.cleaned_data['welcomemail'])  
              customer.save()
  
                      return HttpResponseRedirect('/profile/')
          else:
              check_form=Check_Attribute_Form()
              context={'form':form, 'check':check_form}
                  return render_to_response('customer/customer_register.html',context , context_instance=RequestContext(request)) 
      else:
          ''' user is not submitting the form, show them a blank registration form '''
  
              form = Registration_Form()
          check_form = Check_Attribute_Form()
              context={'form':form,'check':check_form}
              return render_to_response('customer/customer_register.html',context , context_instance=RequestContext(request))
  
  
  ####################################### checkout attributes ##################################################
  
  
  def Checkout_Attributes(request):
  
  
  
      check_form = Check_Attribute_Form()
      context={'form':check_form}
      return render_to_response('customer/checkout.html',context,context_instance=RequestContext(request))
  
  def Set_Checkout_Attributes(request):
  
      #if request.user.is_authenticated():
          #return HttpResponseRedirect('/checkout/')
  
      if request.method == 'POST':
              check_form = Check_Attribute_Form(request.POST)
              #if check_form.is_valid():
              customer_check=Customer_check_attributes(billing_add=check_form.data['billing_add'],shipping_add=check_form.data['shipping_add'],payment_method=check_form.data['payment_method'],shipping_method=check_form.data['shipping_method'],reward_points=check_form.data['reward_points'])
              customer_check.save()
              customer_check.set_customers([user.id])
                      return HttpResponseRedirect('/profile/')
          #else:
              #check_form=Check_Attribute_Form()
              #return render_to_response('a.html',{'check_form':check_form} , context_instance=RequestContext(request)) 
      else:
              return render_to_response('f')
  </code></pre>
  
  <p>I am got struck here for two days but I can't solve it Please help me.</p>
  
  <p><em>Thanks</em> </p>