code: def _rewrite_q(self, q):
          
          if isinstance(q, tuple) and len(q) == 2:
              return rewrite_lookup_key(self.model, q[0]), q[1]
          if isinstance(q, Node):
              q.children = list(map(self._rewrite_q, q.children))
          return q
docs: Rewrite field names inside Q call.