code: def _rewrite_f(self, q):
          
          if isinstance(q, models.F):
              q.name = rewrite_lookup_key(self.model, q.name)
              return q
          if isinstance(q, Node):
              q.children = list(map(self._rewrite_f, q.children))
          # Django >= 1.8
          if hasattr(q, 'lhs'):
              q.lhs = self._rewrite_f(q.lhs)
          if hasattr(q, 'rhs'):
              q.rhs = self._rewrite_f(q.rhs)
          return q
docs: Rewrite field names inside F call.