title: Most effective way to create Attending Event option button [Django/Python]?
body: <p>Trying to implement an "Attending" button. It's simple (or so I thought). A user with a profile clicks "Attending", and a checkmark appears.  Can't quite get this to work on the Django/Python side of things. ie: Put that user who clicked 'Attending' into the attendee(list) within the Event.</p>
  
  <p>Template: </p>
  
  <pre><code>{% if is_attending %}
       &lt;button class="btn" disabled="disabled"&gt;
           &lt;i class="icon-ok-sign"&gt;&lt;/i&gt; Attending
       &lt;/button&gt;
  {% else %}
       &lt;form class="left" method="POST" action="/profile/event/{{ event.id }}/"&gt;
       {% csrf_token %}
            &lt;input type="hidden" name="profile_id" value="user" /&gt;
            &lt;button class="btn"&gt;
                 Attending
            &lt;/button&gt;
       &lt;/form&gt;
  {% endif %}
  </code></pre>
  
  <p>Models:</p>
  
  <pre><code>class Event(models.Model):
      created = models.DateTimeField(auto_now_add=True)
      modified = models.DateTimeField(auto_now=True)
      owner = models.ForeignKey(User, null=True, blank=True, on_delete=models.SET_NULL)
      name = models.CharField(max_length=200)
      location = models.CharField(max_length=200)
      start_date = models.DateTimeField(auto_now=False, auto_now_add=False)
      end_date = models.DateTimeField(auto_now=False, auto_now_add=False)
      about = models.TextField(null=True, blank=True)
      attendees = models.ManyToManyField(Profile, null=True, blank=True)
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>@login_required
  def attending_event(request, event_id):
       event = get_object_or_404(Event, id=event_id)
       if request.method == 'POST':
           try:
               id = request.POST.get('profile_id')
               attendee = Profile.objects.get(id=id)
               relationship = Event.objects.create(attendees__user=attendee)
               is_attending = True
          except:
              pass 
          return HttpResponseRedirect('/profile/event/' + event_id + '/')
      else: 
          if not Event.objects.filter(attendees__user=request.user).exists():
              is_attending = False
      data = { 
          'is_attending': is_attending
          }
      return render_to_response('profiles/event.html', data, context_instance=RequestContext(request))
  </code></pre>
  
  <p>Maybe there's something I'm missing and can't see what it is I'm doing wrong. But if anyone could offer some insight/advice about how to go about completing this; I'd really appreciate it. </p>