title: how to do typecast inside django query filter?
body: <p>I have a query like this:</p>
  
  <pre><code>uids = Message.objects.filter(content_type_id = offer_ct_id).values_list('content_uid', flat=True) 
  
  offer_uids = Offer.objects.filter(uid__in=uids).values_list('uid', flat=True) 
  </code></pre>
  
  <p>where uids is a list of UUIDs</p>
  
  <pre><code>[UUID('e7571ea3-b5b7-48e5-b015-1f03133f2b0c'), UUID('e4e7f0c9-c68d-462e-8bcd-0ae69e43d11f')] and
  </code></pre>
  
  <p>and uid in Offer model is Character field.
  So when I'm using the above query, got an error </p>
  
  <blockquote>
    <p>ProgrammingError: operator does not exist: <code>character = uuid
    LINE 1: ...CT U0."uid" FROM "offers_offer" U0 WHERE U0."uid" IN (SELECT...</code></p>
  </blockquote>
  
  <p>How can I solve this?</p>