title: Django Custom Queryset filters
body: <p>Is there, in Django, a standard way to write complex, custom filters for QuerySets?</p>
  
  <p>Just as I can write </p>
  
  <pre><code>MyClass.objects.all().filter(field=val)
  </code></pre>
  
  <p>I'd like to do something like this :</p>
  
  <pre><code>MyClass.objects.all().filter(customFilter)
  </code></pre>
  
  <p>I could use a generator expression </p>
  
  <pre><code>(x for x in MyClass.objects.all() if customFilter(x))
  </code></pre>
  
  <p>but that would lose the chainability and whatever other functions the QuerySets provide.</p>