title: Django filter __contains=queryset?
body: <p>I'm using Django 1.4.3 w/ Python 2.7 on Ubuntu 13.04.  I've run into a problem and can't seem to find a solution.</p>
  
  <p>I have a series of related models (through FK) and I need to filter through them in a complex way.</p>
  
  <p>Suppose I have a model <code>Car</code> that has <code>Parts</code>.  I can get all the parts as <code>car.parts_set</code>.  Each part has a M2M field <code>excluded_price</code> to <code>Price</code>, with <code>related_name='excluded_prices'</code>.</p>
  
  <p>If I create a new part I need to add prices to the part's <code>excluded_price</code> where each price has <code>excluded_parts</code> for every other part related to that car.  I'm trying to create a filter to help me find these prices.</p>
  
  <p>Essentially I want something like this:</p>
  
  <pre><code>parts_set = [part for part in car.parts_set.exclude(pk=new_part.pk)]
  Price.objects.filter(excluded_parts__contains=parts_set)
  </code></pre>
  
  <p>Effectively I want to find all prices where the <code>excluded_parts</code> is a super set of the specific car parts (excluding the new part, obviously).</p>
  
  <p>I've found a nifty way to do this if the "parts_set" were a series of strings.</p>
  
  <pre><code>parts_set = [Q(excluded_parts__contains=part) for part in car.parts_set.exclude(pk=new_part.pk)]
  Price.objects.filter(reduce(operator.and_, parts_set))
  </code></pre>
  
  <p>Unfortunately <code>__contains</code> only works for strings with an SQL statement of <code>LIKE</code>.</p>
  
  <p>Are there any features in Django's ORM that support a <code>__contains</code> type filter that treats the value as an object rather than a string?</p>