title: Is there a django ORM version of this SQL statement?
body: <p>Using Django 1.9 and Postgres 9.4.</p>
  
  <p>I have a jsonb field called <code>json_field</code>. <code>json_field</code> can contain the key <code>title</code> which could look like <code>'the cow jumped over the moon'</code>.</p>
  
  <p>So I want to search for rows where <code>title</code> contains <code>moon</code>.</p>
  
  <p>It works properly using the following raw SQL</p>
  
  <p><code>SELECT * FROM web_file where (json_field -&gt;&gt; 'title')::text LIKE '%moon%';
  </code></p>
  
  <p>but I'd rather do it using the Django ORM.</p>
  
  <p>EDIT:</p>
  
  <p>I thought to try (and as pointed out by @kloddant)</p>
  
  <pre><code>title = WebFile.objects.filter(json_field__title__contains='moon')
  </code></pre>
  
  <p>but it gives the following error</p>
  
  <pre><code>DataError: invalid input syntax for type json
  LINE 1: ...le" WHERE "web_file"."json_field" -&gt; 'title' @&gt; 'moon' ORD...
                                                              ^
  DETAIL:  Token "moon" is invalid.
  CONTEXT:  JSON data, line 1: moon
  </code></pre>
  
  <p>Here is the relevant <code>models.py</code></p>
  
  <pre><code>from django.contrib.postgres.fields import JSONField
  
  class WebFile(MPTTModel):
      json_field = JSONField(null=True, blank=True, default=dict())
  </code></pre>
  
  <p>It could be a clash between the django model and MPTTModel, although Im doubtful?</p>