title: Use of lambda in filter query in django
body: <p>In my model I have a column name category and the values are in the form of 
  "<code>x -&gt; y -&gt; z"</code><br>
  x,y,z all are separated by arrow (->) (although whole itself is a string)</p>
  
  <p>what I want is to filter objects on the basis of 'y' string</p>
  
  <p>something like</p>
  
  <pre><code>MyModel.objects.filter(category = lambda key: y in key)
  </code></pre>
  
  <p>but it gives me error  <code>TypeError: &lt;lambda&gt;() takes exactly 1 argument (0 given)</code></p>
  
  <pre><code>Example: MyModel (3 column, category column is foreign key to another model(which has only one column same name=category))
  ID   name   category
  1    xyz    world-&gt;europe-&gt;france
  2    abc    animal-&gt;fourleg-&gt;dog
  3    pqr    car-&gt;europe-&gt;benz
  </code></pre>
  
  <p>I applied this below query</p>
  
  <p><code>MyModel.objects.filter(category = lambda key: 'europe' in key)</code>and </p>
  
  <p>And I was expecting two returned objects (Id 1 and 3).</p>
  
  <p>I hope its clear now?</p>
  
  <p>I'm not able to figure it out why this is happening. Or is there any other way to do same thing?
  I'm new to django so it may be meaningless/irrelevant or silly question but I'm not able to find the solution.</p>
  
  <blockquote>
    <p>Python 2.x</p>
    
    <p>Django 1.4.x</p>
  </blockquote>