title: "In" or "reverse contains" query in Django filters for comparing strings
body: <p>I'm writing the backend code for an autocomplete form. Each entry I return is described by a category name and a number within that category.</p>
  
  <p>When the user types "CAT123", I want to use Django filters to filter down to category names or numbers that are contained in the user's query.</p>
  
  <p>In other words, I want to execute a query like:</p>
  
  <pre><code>Entry.objects.filter(Q(category__in = query) | Q(num__in = query))
  </code></pre>
  
  <p>where <strong>the filters test if category <code>AAA</code> is in query <code>AAA 555</code>, and if number <code>555</code> is in query <code>AAA 555</code></strong>, respectively.</p>
  
  <p>However, <code>__in</code> seems to only work for lists, and <code>__contains</code> checks the other way ('AAA 555' is not in 'AAA').</p>
  
  <p><strong>What's the right filter expression to use for this "is contained in a string" idea?</strong></p>
  
  <p>Or is there a way to reverse the <code>contains</code> expression, so that the filter looks like <code>Q(query__contains = category)</code>?</p>