code: def from_dict(cls, dictionary):
      '''Constructs a query from a dictionary.'''
      query = cls(Key(dictionary['key']))
  
      for key, value in dictionary.items():
  
        if key == 'order':
          for order in value:
            query.order(order)
  
        elif key == 'filter':
          for filter in value:
            if not isinstance(filter, Filter):
              filter = Filter(*filter)
            query.filter(filter)
  
        elif key in ['limit', 'offset', 'offset_key']:
          setattr(query, key, value)
      return querf from_dict(cls, dictionary):
      '''Constructs a query from a dictionary.'''
      query = cls(Key(dictionary['key']))
  
      for key, value in dictionary.items():
  
        if key == 'order':
          for order in value:
            query.order(order)
  
        elif key == 'filter':
          for filter in value:
            if not isinstance(filter, Filter):
              filter = Filter(*filter)
            query.filter(filter)
  
        elif key in ['limit', 'offset', 'offset_key']:
          setattr(query, key, value)
      return query
docs: Constructs a query from a dictionary.