(sql, dict_or_list)
Quote whole statement.

    Data values are taken from dict or list or tuple.
Quote whole statement.
Quote whole statement .
def quote_statement(sql, dict_or_list):
    """Quote whole statement.

    Data values are taken from dict or list or tuple.
    """
    if hasattr(dict_or_list, 'items'):
        qdict = {}
        for k, v in dict_or_list.items():
            qdict[k] = quote_literal(v)
        return sql % qdict
    else:
        qvals = [quote_literal(v) for v in dict_or_list]
        return sql % tuple(qvals)
def quote_statement ( sql , dict_or_list ) : if hasattr ( dict_or_list , 'items' ) : qdict = { } for k , v in dict_or_list . items ( ) : qdict [ k ] = quote_literal ( v ) return sql % qdict else : qvals = [ quote_literal ( v ) for v in dict_or_list ] return sql % tuple ( qvals )