title: Django-Filter and query with an array
body: <p>I have a simple question:  Currently I can do this to get an object from my backend: </p>
  
  <pre><code>http://127.0.0.1:8000/api/v1/boats/boats?id=10
  http://127.0.0.1:8000/api/v1/boats/boats?home_port=98&amp;id=5
  </code></pre>
  
  <p>But I'd like to get an array of boats based on a list of ids or a list of home_ports, and I have tried:</p>
  
  <pre><code>http://127.0.0.1:8000/api/v1/boats/boats?id=10,11
  http://127.0.0.1:8000/api/v1/boats/boats?id_in=10,11
  http://127.0.0.1:8000/api/v1/boats/boats?id=10,id=11
  http://127.0.0.1:8000/api/v1/boats/boats?id=10&amp;id=11
  </code></pre>
  
  <p>But these do not work.  What is the best way to do this with django-filter, how are the URL rules defined?</p>
  
  <p>Here is my view:</p>
  
  <pre><code>class BoatList(generics.ListCreateAPIView):
      permission_classes = (IsOwnerOrReadOnly,)
      serializer_class = BoatSerializer
      queryset = Boat.objects.all()
      filter_backends = (filters.DjangoFilterBackend,)
      filter_fields = ('id', 'home_port',)
  </code></pre>
  
  <p>The solution I marked accepted 100% answers my question, but I ended up implementing something different based on another post I found which uses filters:</p>
  
  <pre><code>class ListFilter(Filter):
  
      def filter(self, qs, value):
          if not value:
              return qs
  
          self.lookup_type = 'in'
          values = value.split(',')
          return super(ListFilter, self).filter(qs, values)
  
  class BoatFilter(FilterSet):
      ids = ListFilter(name='id')
  
      class Meta:
          model = Boat
          fields = ['home_port', 'ids']
  
  
  class BoatList(generics.ListCreateAPIView):
      permission_classes = (IsOwnerOrReadOnly,)
      serializer_class = BoatSerializer
      queryset = Boat.objects.all()
      filter_backends = (filters.DjangoFilterBackend,)
      filter_class = BoatFilter
  
      def perform_create(self, serializer):
          serializer.save(owner=self.request.user)
  </code></pre>