code: def deserialize(self, d):
          
          children = []
          for child in d.pop('children'):
              if isinstance(child, dict):
                  children.append(self.deserialize(child))
              else:
                  children.append(self.prepare_value(child))
          query = Q()
          query.children = children
          query.connector = d['connector']
          query.negated = d['negated']
          if 'subtree_parents' in d:
              query.subtree_parents = d['subtree_parents']
          return query
docs: De-serialize a Q object from a (possibly nested) dict.