':return: SQL string.
>>> w = WhereHelper( [ (\'field\', \'3\', \'=\') ] )
>>> w.sql()
\' WHERE field = ?\'
>>> w = WhereHelper( [ (\'field\', \'3\', \'=\'), (\'foo\', \'4\', \'=\') ] )
>>> w.sql()
\' WHERE field = ? AND foo = ?\''

def sql(self, whereStr=True):

    result = ''
    self._values = []
    for cond in self.conditions:
        if isinstance(cond[0], list):
            (item, oper) = cond
            tmpWhere = ''
            for tmpField in item:
                (tmpName, tmpValue, tmpOper) = tmpField
                (sql, value) = self._makePair(tmpName, tmpValue, tmpOper, oper)
                self._values.append(value)
                tmpWhere += sql
            if tmpWhere:
                result += (('    AND    (' + tmpWhere[(len(oper) + 1):]) + ')')
        else:
            (sql, value) = self._makePair(cond[0], cond[1], cond[2])
            self._values.append(value)
            result += sql
    result = result[5:]
    if (whereStr and result):
        result = ('    WHERE    ' + result)
    return result
