title: How to filter for multiple ids from a query param on a GET request with django rest framework?
body: <p>I'm trying to make a web app API.  I want to make an API request where multiple ids can be submitted.</p>
  
  <p>The <a href="http://www.django-rest-framework.org/#tutorial" rel="noreferrer">django rest framework tutorial</a> shows how to get all records from a model.  For example <a href="http://127.0.0.1:8000/snippets/" rel="noreferrer">http://127.0.0.1:8000/snippets/</a> will return all snippet records.  The tutorial also shows how to retrieve a single item from a model. <a href="http://127.0.0.1:8000/snippets/2/" rel="noreferrer">http://127.0.0.1:8000/snippets/2/</a> will return only snippet record with pk=2.  </p>
  
  <p>I'd like to be able to request multiple records, but not all records.</p>
  
  <p>How could I change this code so I could request multiple snippets?</p>
  
  <p>snippets/urls.py</p>
  
  <pre><code>from django.conf.urls import url
  from snippets import views
  
  urlpatterns = [
      url(r'^snippets/$', views.snippet_list),
      url(r'^snippets/(?P&lt;pk&gt;[0-9]+)/$', views.snippet_detail),
  ]
  </code></pre>
  
  <p>snippets/views.py</p>
  
  <pre><code>def snippet_detail(request, *pk):
      try:
          snippet = Snippet.objects.filter(pk__in=pk)
      except Snippet.DoesNotExist:
          return HttpResponse(status=404)
  
      if request.method == 'GET':
          serializer = SnippetSerializer(snippet)
          return JSONResponse(serializer.data)
  </code></pre>