title: why my upvote button only works for the first post?
body: <p>I follow the instruction in  <a href="http://www.tangowithdjango.com/book17/chapters/ajax.html" rel="nofollow">tangowithdjango</a> to add a 'like' button into my forum app.</p>
  
  <p>the html file  and javascript:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script&gt;
  $(document).ready(function(){
    $("#upvote").click(function(){
      var postid;
      postid = $(this).attr("data-r-id");
      $.get('/upvote/', {post_id: postid}, function(data){
                 $('#like_count').html(data);
                
      });
    });
  });
  &lt;/script&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;a id="upvote" data-r-id="{{r.id}}" class="label-info label pull-right"&gt;赞&lt;div id="like_count"&gt;{{r.upvotes}}&lt;/div&gt;&lt;/a&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>views.py</p>
  
  <pre><code>def upvote(request):
      post_id = None
      if request.method == 'GET':
          post_id = request.GET['post_id']
      votes = 0
      if post_id:
          p = post.objects.get(id=post_id)
          if p :
              votes = p.upvotes + 1
              p.upvotes = votes
              p.save()
      return HttpResponse(votes)
  </code></pre>
  
  <p>urls.py</p>
  
  <pre><code>urlpatterns = patterns(
      url(r'^upvote/$', 'upvote', name='upvote'),
  )
  </code></pre>
  
  <p>when click the  #upvote button ,the #like_count increase by one . However , it works just for the first post. If I click the rest of posts , I get no response at all.</p>