(self, new_query, clause)
return self
Add a query to the current list of queries
Add a query to the current list of queries
Add a query to the current list of queries
def add_query(self, new_query, clause):
        """
        Add a query to the current list of queries
        """
        current_query = self._query.get(queries.BOOL)
        if current_query is None:
            return self.set_query(
                queries.BOOL_CLAUSE(
                    queries.CLAUSES[clause]([new_query])
                )
            )
        elif current_query.get(clause) and isinstance(current_query[clause], list):
            current_query[clause] += [new_query]
        else:
            current_query.update(
                queries.CLAUSES[clause]([new_query])
            )
        return self
def add_query ( self , new_query , clause ) : current_query = self . _query . get ( queries . BOOL ) if current_query is None : return self . set_query ( queries . BOOL_CLAUSE ( queries . CLAUSES [ clause ] ( [ new_query ] ) ) ) elif current_query . get ( clause ) and isinstance ( current_query [ clause ] , list ) : current_query [ clause ] += [ new_query ] else : current_query . update ( queries . CLAUSES [ clause ] ( [ new_query ] ) ) return self