title: queryset filtering via a list of query values
body: <p>A beginner django question...</p>
  
  <p>Here's a JSON response...</p>
  
  <pre><code>"data": [
  {
      "type": "Subject",
      "id": "0",
      "attributes": {
          "created": "2019-01-01T00:00:00Z",
          "modified": "2019-01-01T00:00:00Z",
          "subject_code": "A&amp;H",
          "subject_name": "AH",
          "subject_short_name": "A &amp; HUM"
      },
      "relationships": {
          "organization": {
              "data": {
                  "type": "Organization",
                  "id": "61"
              }
          },
          "created_user": {
              "data": null
          },
          "last_updated_user": {
              "data": null
          }
      },
      "links": {
          "self": "http://localhost:8001/v1/subject_owner/0"
      }
  },
  </code></pre>
  
  <p>The above response is coming from a serializer </p>
  
  <pre class="lang-py prettyprint-override"><code>queryset = Subject.objects.all()
  </code></pre>
  
  <p>I have a query which is </p>
  
  <pre><code>http://localhost:8001/v1/subject_owner?owner_ids=62,63
  </code></pre>
  
  <p>So, how do we write a filtering condition for the owner_ids as a list? The response should have only the results where the owner_ids match organization_id. I have tried few:</p>
  
  <pre class="lang-py prettyprint-override"><code>queryset.filter(organization__in=[owner_id_list])
  </code></pre>
  
  <p>and </p>
  
  <pre class="lang-py prettyprint-override"><code>queryset.filter(organization=owner_id_list)
  </code></pre>
  
  <p>and obviously they don't work. Any help will be appreciated.</p>
  
  <p>FYI, here's the model class...</p>
  
  <pre class="lang-py prettyprint-override"><code>class SubjectManager(models.Manager):
  
      def get_by_natural_key(self, subject_code):
          return self.get(subject_code=subject_code)
  
  
  class Subject(get_subject_base_class(Organization)):
  
      objects = SubjectManager()
  
      def __str__(self):
          return self.subject_code
  
      def natural_key(self):
          return (self.subject_code,)
  </code></pre>