title: Django - an equality check in annotate-clause
body: <p>In my Django 1.9 project I am trying to output something like this:</p>
  
  <pre><code>return MyModel.objects.values(...).\
                 annotate(flg = ExpressionWrapper(F('rgt') - F('lft') &gt; 0, 
                          output_field = BooleanField()))
  </code></pre>
  
  <p>This yields <code>AttributeError: 'bool' object has no attribute 'resolve_expression'</code> error.</p>
  
  <p>I try to rewrite it using <code>Case-when</code> syntax:</p>
  
  <pre><code>return MyModel.objects.values(...)\
                .annotate(flg = Case(When(F('rgt') - F('lft') &gt; 0, then = True, 
                 output_field = BooleanField())))
  </code></pre>
  
  <p>This time, I end up with <code>TypeError: __init__() takes either a Q object or lookups as keyword arguments</code> error. I am lost. Any ideas ?</p>